How to present a variable number according to it's size? Regex?

Hi, community! Got a question. How to present a variable number according to it’s size in millions, billions and trillions?
So for example:
12345678 > 12,35M
1234567890 > 1,24B
1234567891234 > 1,24T

Thanks! :wink:

Its an interesting question, did you come up with a solution?

I’d likely look for or write javascript to do it, and use a Toolbox Expression.

1 Like

I agree with @mishav, if you can find some JS code that does this, that’s probably the quickest approach, but you could also use conditions …

when value >= 1000000 then text = value / 1000000:rounded to 2M
when value >= 1000000000 then text = value / 1000000000:rounded to 2B
etc

2 Likes

That is a great work-around, @louisadekoya!

1 Like