Percent input showing incorrect

Hi

We are querying SQL data which contains a decimal number for a percentage value. When this query is linked to either the table or number input with percent format set it is multiplying the value by x100 so 15.000 in the SQL table which should display as 15% is showing as 1,500% in either the table or number input. Same thing if we use the number input field set to percent to read its value it visibly shows as 15% in the input field but the value is read as 0.15. Can anyone advise how to get the retool table and number input field to show and read the correct values without performing sums on the SQL data.

Thanks
Matt

Hello, thats how percents works
0.1 = 10%
0.5 = 50%
1.0 = 100%
10.0 = 1000%
15.0 = 1500%

you would need to divide your numbers by 100 or change them to be numbers between 0 and 1

e.g.
15.0 / 100 = 0.15 = 15%

Thanks, I understand thats how percentages work. However what is frustrating is if we are feeding the table or number input (percent field) a value from a SQL query e.g. 15 we would expect it to show that value e.g. 15% in the table or field. Not automatically divide that value by 100 and display 0.15 - just seems odd for it to decide to perform its own calculations and not just display the value it has been given.

i think it expects that you have already done 15/100 to obtain that percent
and multiplies by 100 to obtain the integer to display

15/100 => 0.15 => (0.15 * 100) => 15%

e.g
you have 15% but you cannot store percents so you convert it by doing 15/100 and you get 0.15

1 Like

Hi there,

Thanks for this feedback! We do some automations to help with spinning up quickly, but to get around this, I'd recommend using Oscar's workaround of converting your data for the table:

If the percentages will not be editable, you could also consider making the column a string column - which will not change the way the numbers are presented and then you could add a "%":