Difference between revisions of "$int"

From Scriptwiki
Jump to: navigation, search
m (fixed commenting)
m
Line 13: Line 13:
 
  [[$calc]](%i - %int(%i))  ;will return ''0.5''
 
  [[$calc]](%i - %int(%i))  ;will return ''0.5''
 
The above example shows how to return the remainder from a decimal number.
 
The above example shows how to return the remainder from a decimal number.
 +
 
== See also ==
 
== See also ==
 
+
* [[$round]]
[[$round]], [[$ceil]] and [[$floor]].
+
* [[$ceil]]  
 +
* [[$floor]]
  
 
[[Category:Text and Number Identifiers]]
 
[[Category:Text and Number Identifiers]]

Revision as of 10:03, 2 July 2007

Returns the specified integer number without rounding.

$int(N)
  • N is the number with decimals you want to handle.

Examples

$int($pi)  ;will return 3
$int(9312412.3213)  ;will return 9312412
var %i = 2.5
$calc(%i - %int(%i))  ;will return 0.5

The above example shows how to return the remainder from a decimal number.

See also