Forum Academy Marketplace Showcase Pricing Features

Formatting a long number to short version?

Hello everybody,

I want to show some financial information such as Market Cap in a short version (x Mil/k).
I would need to recognise whether a number that I get from an API is in millions, thousands or hundreds and then show Mil, k or nothing instead.
So if it’s for example 234000000 I would need to make it look like this: 234 Mil - if it’s 832000.56 I would need to transform it into 832 k.

Does anybody know if it is possible and how to do it?
Thank you for the help!

  • Use a plugin to count the number of characters such as 🎛 New plugin - theCountable (now free).
  • Configure an options set for millions, thousands, hundreds, etc
  • When the number comes in set the condition to match the option to the number of characters
  • With that option identified use “:truncate to” and set the appropriate number of characters to achieve 234M or 32K , etc etc

Thank you for your help!

It seems Countable works only for inputs… But I achieved the same results by using bubble :number of characters :slight_smile:

Even better! :+1:

1 Like

Yes :muscle:

I asked here but I was wondering also if you have any insights on whether it is better to save a datapoint that I get from an external API in the database or as a temp when using it in the conditions.

Reduce interactions with the database as much as possible. So … temp data that came in from the AP call is immediately available in the flow … thus your conditions should perform better.

1 Like

Thank you again!

1 Like