I need to format float like price for two decimal places and t开发者_JAVA百科housands spaces, like this: "1 082 233.00"
Use number_to_currency
or number_with_precision
:
number_with_precision(1082233, :precision => 2,
:separator => '.',
:delimiter => ' ')
# => '1 082 233.00'
See the NumberHelper documentation for details.
精彩评论