Forum Discussion

DRamirez's avatar
DRamirez
Practitioner III
2 years ago

How to convert e-06 number to 0.0000... number with liquid

Hi everybody!

I was wondering: I am getting a number with connected content that has 8 numbers behind the 0 (0.00000677). I want this number to show up with all of the numbers behind the 0, but for some reason Braze returns this: 6,77e-06. Is there a way to keep the number like the 0.000... ?

In the code I am using, I have some rules set up for how different number sizes should show, so maybe it could also be that i have done something wrong:

 

<td align="right" style="font-size: 22px; font-family: Viga, Arial, Helvetica, sans-serif; color: #000000; font-weight: bold;"><span style="font-size:20px;">โ‚ฌ {% if coin_price == 0 %}{{coin_price | round: 2 | replace: ".", ","}}{% elsif coin_price < 0.0001 and coin_price > -0.0001 %}{{coin_price | round: 8 | replace: ".", ","}}{% elsif coin_price < 0.01 and coin_price > -0.01 %}{{coin_price | round: 6 | replace: ".", ","}}{% elsif coin_price < 1 and coin_price > -1 %}{{coin_price | round: 4 | replace: ".", ","}}{% else %}{{coin_price | round: 2 | replace: ".", ","}}{% endif %}</span></td>
                                                                                    </tr>

 

  • DavidO's avatar
    DavidO
    Strategist II

    ๐Ÿ‘€ this one as I just tried a whole bunch of filters, abs, decimal, format, split... tried to convert to string and even split it at the decimal to try and force it to become a string. Currently, it feels like Braze is converting all those decimals before you get a chance to format it. Must be missing something.

    There has to be a way. ๐Ÿค”๐Ÿ˜Š

    • DRamirez's avatar
      DRamirez
      Practitioner III

      Yeah hahahah it's a journey ๐Ÿ˜„ I indeed also tried the convert to string thing but it didn't work for me either.