# WordPress.org

## TablePress[resolved] Decimal ending in zero for currencies (4 posts)

1. Nivison
Member
Posted 1 year ago #

Howdy. I have a spreadsheet of prices that need to be rounded to the nearest nickel. I have the formula:

=ROUND((A1*.66)*20,0)/20

Where A1 = 21.95

The result is 14.5 which is correct, but I'd like to have zero on the end because it is a currency. Is there a way to do this. If so can you provide the correct function. I found a similar problem in the forums, but it didn't look resolved.

Thanks,

Best,

j

2. TobiasBg
Member
Plugin Author

Posted 1 year ago #

Hi,

thanks for your post, and sorry for the trouble.

For that, you can use the `NUMBER_FORMAT()` function (see http://tablepress.org/tablepress-features-formulas/ for more):

``=NUMBER_FORMAT( A1 * .66, 2 )``

The `2` indicates that you want to decimals after the period.
I also removed the multiplication and division by 20, as that's not necessary mathematically, at least in this example.

Regards,
Tobias

3. Nivison
Member
Posted 1 year ago #

Thanks man. I used the multiplication and division to round it up to the nearest nickel. So for anyone else looking, this works:

=NUMBER_FORMAT (ROUND((A1*.66)*20,0)/20,2)

4. TobiasBg
Member
Plugin Author

Posted 1 year ago #

Hi,

ah, yes, totally misread that rounding towards the "nickel". Then the multiplication and division makes sense of course. :-)
Good to hear that this helped!

Best wishes,
Tobias

P.S.: In case you haven't, please rate TablePress here in the plugin directory. Thanks!

This topic has been closed to new replies.