Rounding negative numbers that end in 50 not rounding correctly
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am using the following formula to round my numbers to the nearest 100. It works for all but any negative number ending in 50.
Creating a new field called New Amount: Round([Amount]*[Rate],100).
Here is a small sample of both expected and unexpected results.
Amount | New Amount | Should be |
254.24 | 300.00 | 300.00 |
3757.173333 | 3800.00 | 3800.00 |
294.24 | 300.00 | 300.00 |
176.96 | 200.00 | 200.00 |
-5250 | -5200.00 | -5300.00 |
-50 | 0.00 | -100.00 |
-150 | -100.00 | -200.00 |
-750 | -700.00 | -800.00 |
Solved! Go to Solution.
- Labels:
- Expression
- Input
- Output
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
-5250 will round up to the bigger nearest 100.
In this case -5200 is the bigger number and -5300 is the smaller number and the same for all your other negative numbers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@DavidP Thank you. Should I use an IF statement, one for >=0 and one for <0? And, if so, how would I write the formula?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sonseeahray ,
You can use the following formula:
if [Amount]>0 then Round([Amount], 100)
else -Round(-[Amount], 100)
endif
Best,
Fernando Vizcaino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@fmvizcaino Thank you. That is it!
