Is it possible to round to a specific decimal place? I’m trying to show a simplified version of high numbers (4,000,000 --> 4M). The millions work fine by dividing by 1M. But, when I try to round the variable, it’ll round too high and show 5M when in reality it’s 4.9M.
*temp shortbudget 0 *temp unit "M" *if budget >=1000000 *set shortbudget (budget)/1000000 *set shortbudget round(shortbudget) *set unit "M"
Then the thousands. I want to show them as 900K, 90K, 9K etc, and that works fine with this code:
*if ((budget >=1000) and (budget <=999999)) *set shortbudget (budget)/1000 *set shortbudget round(shortbudget) *set unit "K"
Until I round and it shows as 1000K instead of 999K. Or 26K instead of 25.9K. Without rounding it shows at 999.999K.
Is there any way around this? Or will I have to make sure you can only have 0s and nothing in between?