TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

Formating numeric fields

I want the data that is stored in my database as float type to show as a float in the label that's mapped to it. Is this possible?

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

Formating numeric fields

Sorry I sorted it.

var tprice = value.parseFloat();
return tprice;

in the mapping:)

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

Formating numeric fields

Just an update anyone know why toFixed wont add trailing zeros?

so numbers show as 365.50 and not just 365.5

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Formating numeric fields

Hi Tony -

You can pass the number of digits to appear after the decimal point into this method: code.toFixed([digits])/code

More info you can find here: https://developer.mozilla.org/en-US/d...

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

Formating numeric fields

Yeah I know but this doesn't work...

var tprice = value.parseFloat().toFixed(2);
return tprice;

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

Formating numeric fields

is it the parseFloat?

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

Formating numeric fields

Yep; it was the parseFloat:)

Return to “Issues”