Format given number to a fix number of decimal points (default: 2)

number:fix_decimal_points($num, INT $decimal_points=2) : STRING

number:fix_decimal_points(10)
#=> "10.00"

number:fix_decimal_points(10.009)
#=> "10.01"

number:fix_decimal_points(10.23, decimal_points: 10)
#=> "10.2300000000"

number:fix_decimal_points(10.23989, 0)
#=> "10"

Copyright ©2013-2022 SunSed®. All rights reserved.