Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

2 decimal places ruby

number = 1.1164
number.round(2)
Or
sprintf('%.2f', number)
 
PREVIOUS NEXT
Tagged: #decimal #places #ruby
ADD COMMENT
Topic
Name
4+2 =