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

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -