round up to nearest .99

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a series of prices. I want to round each price up to the nearest ninety-nine cents. So that:

12.00 rounds up to 12.99  

56.75 rounds up to 56.99

24.90 rounds up to 24.99

But I can't make this work using round or ceiling. Please help, and thank you.

-Ryan

Photo of Ryan

Ryan

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,004 Points 20k badge 2x thumb
Round([price], 1) - 0.01
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,096 Points 50k badge 2x thumb
Actually it should be
If([Price]>0, Floor([Price],1) + 0.99
Photo of Ryan

Ryan

  • 0 Points
Not entirely, if the price is 12.53 it does round to 12.99. BUT if the price is 12.43 it rounds down to 11.99. I need it to always round up. Is this even possible?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,004 Points 20k badge 2x thumb
I think we are both wrong. Try this:



Floor([price],1) + 0.99

UPDATE:

Max(0, Floor([price],1) + 0.99);



The differences in the various answers is due to rounding up or to nearest and protecting against a negative value.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,096 Points 50k badge 2x thumb
Actually it should be
If([Price]>0, Floor([Price],1) + 0.99
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,004 Points 20k badge 2x thumb
>Is this even possible?

Everything is possible.
Photo of Ryan

Ryan

  • 0 Points
This is the best support group without exception!!
Photo of Ryan

Ryan

  • 0 Points
This is the best support group without exception!!  The first one here (Floor([EUR price strt],1) + 0.99 is working just fine! And don't try to tell me it won't work with Euros (LOL) because all our money is metric!! THANKS TO ALL !!
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,004 Points 20k badge 2x thumb
>all our money is metric!!

I am moving to ether from bitcoin. Ethereum: https://www.ethereum.org/