suve
Warning: Illegal string offset 'doublequoteopening' in /usr/home/svgames/domains/svgames.pl/public_html/dokuwiki/inc/parser/xhtml.php on line 766 Warning: Illegal string offset 'doublequoteclosing' in /usr/home/svgames/domains/svgames.pl/public_html/dokuwiki/inc/parser/xhtml.php on line 774

awful: function: round

Declaration

int :round ( float $NUMBER )

Summary

Returns the specified number rounded to the nearest integer.
Half-values (X.5) are rounded farther from zero (+5.5 becomes +6, and -5.5 becomes -6). 1)

Example

# :round example
:set &flo f''
:write s'Gibe number: '
:read &flo
 
:writeln s'Rounded number:   ' :round $flo
:writeln s'Rounded negative: ' :round :sub i0 $flo
1)
Prior to rev.33 (v.0.4.2), half-values were using pbankers roundingp, always rounding towards the even value - so 3.5 would be rounded towards 4, but 2.5 would be rounded towards 2.

wikistrona zmodyfikowana 2014/0916/1551