# Difference between revisions of "INT"

From Macros Wiki

(2 intermediate revisions by the same user not shown) | |||

Line 1: | Line 1: | ||

+ | [[:Category:Internal_Macro_Functions|{{Up}}]] | ||

+ | |||

{{Command|syntax=[[Image:int.png|right|INT]]INT <n> | {{Command|syntax=[[Image:int.png|right|INT]]INT <n> | ||

− | |description=:Returns the integer value of a number, to | + | |description=:Returns the integer value of a number. This is the whole part of the number, without the portion after the decimal point.<br> |

+ | :To round to the nearest integer value [[rounding|see this example]]. | ||

|param1=<n>|param1_desc={{n}} | |param1=<n>|param1_desc={{n}} | ||

Line 6: | Line 9: | ||

===Example=== | ===Example=== | ||

− | :INT( | + | :a1 = INT(r1) |

+ | |||

+ | :a2 = INT(r1/14.2) | ||

+ | |||

+ | :a3 = INT(1.23) | ||

[[Category:Internal_Macro_Functions]] | [[Category:Internal_Macro_Functions]] |

## Latest revision as of 17:36, 30 July 2010

### Command

- INT <n>

- Returns the integer value of a number. This is the whole part of the number, without the portion after the decimal point.
- To round to the nearest integer value see this example.

### Parameters

- <n>
- Anything that evaluates to a number. This can be a variable, a number, another function, or an expression which includes numbers, variables and/or functions.

- For example:

- 123
- r1
- r2 + r3
- (r1 + (abs(a1 * a2) / (b3 * 62)))

### Example

- a1 = INT(r1)

- a2 = INT(r1/14.2)

- a3 = INT(1.23)