method
number_with_precision
number_with_precision(number, precision=3)
public
Formats a number with a level of precision. Example:
number_with_precision(111.2345) => 111.235
Register or
log in
to add new notes.
clescuyer -
July 9, 2010 - (>= v2.2.1)
0 thanks
Separator default is not always "." but depends on locale
Locale en:
number_with_precision(111.2345) # => 111.235
Locale fr-FR:
number_with_precision(111.2345) # => 111,235
Same with delimiter.