# LabVIEW

cancel
Showing results for
Search instead for
Did you mean:

Solved!
Go to solution

## LabVIEW Equivilant to excel functions?

Hi, I'm trying to translate some equations done in Excel into LabVIEW.

Does anyone know what the LabVIEW equivilant is for the Excel command:

ROUND(x,0)

Also, what is the equivilant for

INT(x)

Many thanks, Alec

Message 1 of 17
(4,842 Views)

## Re: LabVIEW Equivilant to excel functions?

Here you go:

The top 3 functions, from left to right:
1) Round to nearest

2) Round down

3) Round up

The palette below shows all types of numeric type conversions.

To convert to int, you can do I64, I32, I16, or I8

Message Edited by Cory K on 08-13-2009 10:13 AM
Cory K
Message 2 of 17
(4,834 Views)

## Re: LabVIEW Equivilant to excel functions?

I am aware these functions, but I don't think one of those works in exactly the same way as ROUND(x,0) do they.. or do they?
Message 3 of 17
(4,826 Views)

## Re: LabVIEW Equivilant to excel functions?

To be honest, I'm not sure because I dont use excel much.

What exactly does ROUND(x,0) do in excel?

Once I know the functionality, I can point you to a better function.

Cory K
Message 4 of 17
(4,824 Views)

## Re: LabVIEW Equivilant to excel functions?

Round Numbers

The ROUND Function will round numbers to a specified number of digits. If the number of digits is negative, it will round to the left of the decimal point. If zero it will round to the nearest Integer (whole number).

=ROUND(1.5,0) will result in a value of 2

=ROUND(1.4,0) will result in a value of 1

Round Numbers Up

The ROUNDUP function will round numbers up, away from zero.

=ROUNDUP(1.4,0) will result in a value of 2

Round Numbers Down

The ROUNDDOWN function will round numbers down, toward zero.

=ROUNDDOWN(1.6,0) will result in a value of 1

INT (although less flexible) can also be used. =INT(1.6) will also result in 1

Message 5 of 17
(4,818 Views)

## Re: LabVIEW Equivilant to excel functions?

If you are going to input the second parameter as 0 : ROUND(x,0)

Then you will want to use round to nearest.

The cutoff with be .5

An odd number will round up, and an even number will round down.

Ex:
13.5 --> 14

16.5 --> 16

11.3 --> 11

11.8 --> 12

Cory K
Message 6 of 17
(4,811 Views)

## Re: LabVIEW Equivilant to excel functions?

The Rounds in LabVIEW do not have decimal place inputs, so are equivalent to the ROUND, ROUNDUP, and ROUNDDOWN with the second parameter set to 0.  ROUND is Round to Nearest.  IF you want decimal places, you will have to do your own coding to shift the decimal places and do rounding.
Message 7 of 17
(4,810 Views)
Solution
Accepted by alecjcook

## Re: LabVIEW Equivilant to excel functions?

Matthew Kelton wrote:
The Rounds in LabVIEW do not have decimal place inputs, so are equivalent to the ROUND, ROUNDUP, and ROUNDDOWN with the second parameter set to 0.  ROUND is Round to Nearest.  IF you want decimal places, you will have to do your own coding to shift the decimal places and do rounding.

So Round(x,d) will impement as I missed the negate of d on the first shot

Message Edited by Jeff Bohrer on 08-13-2009 11:01 AM

"Should be" isn't "Is" -Jay
Message 8 of 17
(4,794 Views)

## Re: LabVIEW Equivilant to excel functions?

Wow, nice job Jeff
Cory K
Message 9 of 17
(4,788 Views)

## Re: LabVIEW Equivilant to excel functions?

Thanks Cory.  pretty basic

"Should be" isn't "Is" -Jay
Message 10 of 17
(4,777 Views)