Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I'm handling with some numbers and I want to add to the rounded number a specific faktor.
Like:
if round down -> add 150 if round up -> add 100
Is there any possibility to check if the computer is rounding up or down?
你可以知道你是像这样向上还是向下取整
float roundedNbr = Math.round(originalNbr); if(roundedNbr < originalNbr) { // We rounded down } else if (roundedNbr > originalNbr) { // We rounded up } else { // No rounding }