Conditional expression that abbreviates large numbers

How can you write a conditional expression that abbreviates large numbers such as:
1,543,128 = 1.5m
33,764 = 33.7k

  • When number >= 1,000,000 then divide it by 1,000,000 then format the number to 1 decimal place

  • When number >= 1,000 then divide it by 1,000 then format the number to 1 decimal place

  • When number < 1,000 then just display the number

@wharvey2433 and of course append “M” or “k” to first and second conditional

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.