I have a dynamically generated table that multiplies price * qty. Some of the prices are in partial cents. For example
if the price of an item is 0.0375 I can display that in my table as
number_to_currency(0.0375,:precision => 4)
=> $0.0375
but on quantities where the price is a standard 2 decimal number I get
number_to_currency(33.95,:precision => 4)
=> $39.9500
I need a way to trim the trailing zeroes of a decimal value. Keep in mind that the output is in a Model.each block so I'm uncertain I can modify the precision parameter conditionally.