currency - Rails 2 - Absolute of money -
how absolute value of money? e.g:
-2.to_money.? = 2.to_money 2.to_money.? = 2.to_money
i have attribute total_price, may positive or negative. want calculate absolute value of total_price.
try taking absolute value before converting money.
2.abs.to_money
Comments
Post a Comment