user938363
user938363

Reputation: 10358

number_with_precision adds zero to the number

Assume @total=100. Then number_with_precision(@total, :precision => 2) returns 10000 instead of 100.00.

We are running rails 3.2 and ruby 2.1. This helper method used to be fine. What causes the problem?

Upvotes: 0

Views: 101

Answers (1)

Sagi
Sagi

Reputation: 578

Perhaps number_with_precision(@total, :precision => 2, :separator => '.') might help?

Upvotes: 1

Related Questions