Help : Rounding to nearest 2 decimal points

abs result

  • For non-currencies calculating:

        Using ABS(), How to display this A*B results (multiply) such as:
    

7408.82 ? or 7408.83
(rounding only at the 2nd digit level which seems appropriate)
*ROUND() would just remove anything after the dot (7409) :face_with_raised_eyebrow:

thanks for any tips :wink:

Any ROUND(A*B.2) on the roadmap ? *2 = last digits

(result is fine but only when used with a Currency formats)

I am not exactly sure, where you want to have the rounding.
But you can use a combination of INT() and ROUND() with scaling factors inside and outside the functions to cut where you need it:


image or
image
You can play with the scaling factors in my test app here:

4 Likes

Hi Karimoo,
Yes, scales seems to be the “Truncating function” that I’m looking for, great jobs Thanks…

I said seems because I cant test it yet…so how do you access this “Scale” function from ?
(I cant type the word, and I dont see it in my function list. ???) :roll_eyes:
Mine only list 7 functions…:open_mouth:
00 functions no scale

@bibipac Sorry for the confusion.
Scale is not a Adalo function is just the name of the Input field I used. Just replace it with the number you want to use for scaling:

With Rounding:
Scale = 100
Round(77.62 x 95.45 x 100)/ 100 = 7408.82
Here you basically scale up by two digits within the ROUND() function, and scale back the rounded result.

To cut it using INT() without rounding:
Scale 1 = 10000 Scale 2 = 100
INT(77.62 x 95.45 x 10000/100)/10000*100
With Scale 1 you basically decide where you want to cut using the INT() function and Scale 2 is doing the up and downscaling as in the example before.

Oh…okay, Waow…I never though that using 100 would be usefull in achieving the required 2 digit results, that’s very clever ! I must run a test now to see how this work, I got the idea but its still surpring to me ! (I m not too much of a Math person :smile: )
Anyway, Thanks you very much… indeed you seems to be the Math Guru in here…and willing to share your knowledge too… :wave: :wave: :leopard:

1 Like

Great, tested and aprooved !

though I ve used the Scale 1 config only, interesting to see that you can play on the scales !
scale formula
Thanks a lotscaling solved
:v:

@karimoo What’s the best way to do this when the trailing digits are zeroes (e.g. 57 to 57.00)?

As far as I know, Adalo currently does not support different formatting of decimals for display. A workaround would be to split the decimals in a separate string and use conditional formatting to show “00” if the decimal value is zero.

2 Likes

times it by 100, round to integer, divide by 100 :slight_smile:

Hi @karimoo

Thank you for sharing your knowledge here but I have a question for you, this scenario not working for me when I’m applying it on the rating system that means I want to show only 2 decimal places for the average rating, Here is an example -

Sum of stars = 1650
Total no. of users submitted = 450
so it should show = 3.67/5 but the result is 3.66666666667

Appreciate your help here :+1:

Hi @ishantanusrivastava,

You can try:
ROUND( ( SumStars / NumUsers) * 100 ) / 100

Best regards, Victor.

2 Likes

I know it’s an old post @Victor - but the syntax just got me out of pickle - thanks bro :nerd_face: :+1:

1 Like