לוחות מודעות לוחות מודעות

חזרה

Rounding numbers

מתג
Rounding numbers
תשובה
13:11 16/09/20
Hello,

I'd like to round a calculation to one decimal place. I used the purple "round" action block in the Value actions category, and this works, but it is rounding to the closest whole integer. Is it possible to round to one decimal place?

Thanks
0 (0 הצבעות)

RE: Rounding numbers
תשובה
15:57 16/09/20 כתגובה ל-Pat Telan
Hi Pat,
Great question! You actually cannot control what decimal you're rounding to, but there's a pretty easy workaround. Let's say you have a number 2.576 that you want to round to 2.6. I will take 2.576, multiply it by 10, round, and then divide by 10. See attached image.

You can also use a Number Input object, and set it to read only and use 1 decimal place, but this doesn't actually round, it only truncates - so 2.576 would become 2.5. However, using a Number Input object set to read only is a great way to format your values. https://www.screencast.com/t/mhmm7r6q8sW

Hope that helps!

קבצים מצורפים:

קובץ מצורף

0 (0 הצבעות)

RE: Rounding numbers
תשובה
14:34 21/09/20 כתגובה ל-Navdeep Dhillon
This is great. Thank you! I'll use the first approach since I don't need to use prefixes or suffixes.
0 (0 הצבעות)