Convert Text Decimal to Percentage in Table?

Options
Thomas_937381
Thomas_937381 Posts: 196
edited April 2020 in Questions

Is there a simple formula that could be used to convert a decimal value (in a text-type column) with a variable number of digits to a percentage?

Trying to get from this: 0.3455764
To this: 34.55%

Best Answer

  • Thomas_937381
    Thomas_937381 Posts: 196
    Answer ✓
    Options

    Thanks @Jozef_783863 , but I'd actually prefer not to start a batch for this (since I'm working with a table). This is what I've come up with, and it seems to work:

    columns['Percentage'] = (parseFloat(columns['Percentage']) * 100).toFixed(2).concat('%')

Answers

  • Jozef_783863
    Jozef_783863 Posts: 331 admin
    edited April 2020
    Options

    You can use Field: Set Value of a Decimal Field to round the number, by entering the number of decimal places. Can this work? @Thomas_145739

  • Jozef_783863
    Jozef_783863 Posts: 331 admin
    Options

    Glad you found a working table formula @Thomas_145739.

    After some testing, Field: Set Value of a Decimal Field would round 0.3455764 to 0.346 if you use 3 decimal places. So it does not quite work the way you need it.