ridxery
Posts: 0
Joined: Tue May 13, 2014 9:48 pm

Is there anyway I can limit the string length in the database or before sending latitude and longitude to the database?

Use Javascript to format it like this:

Number(1.33555).toFixed(2); // 1.34 , toFixed() rounding up too, if you dont believe me test it :

http://jsfiddle.net/FQTqk/730/

pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

Is there anyway I can limit the string length in the database or before sending latitude and longitude to the database?

Thanks, but I am afraid I need step by step instruction where to add this JS. Somewhere when I do mapping?

ridxery
Posts: 0
Joined: Tue May 13, 2014 9:48 pm

Is there anyway I can limit the string length in the database or before sending latitude and longitude to the database?

you can do it on mapping tab like create 2 local variables from right top at data mapping tab, then you can click to add JS (next to the created local variable) you should see a tab saying,

function (value , element) {
parseFloat(value).toFixed(6);
}

PS: you dont need to create local variables to do this, any entity got JS button next to them however saving user's location would be good , you might need it again.

ridxery
Posts: 0
Joined: Tue May 13, 2014 9:48 pm

Is there anyway I can limit the string length in the database or before sending latitude and longitude to the database?

you dont need to create local variables to the this, any entity got JS button next to them however saving user's location would be good , you might need it again.

pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

Is there anyway I can limit the string length in the database or before sending latitude and longitude to the database?

I have put it here but it did not work

Image

Have I done sth wrong?

Image

ridxery
Posts: 0
Joined: Tue May 13, 2014 9:48 pm

Is there anyway I can limit the string length in the database or before sending latitude and longitude to the database?

var x = parseFloat(value).toFixed(6);

return x;

try this one.

Return to “Issues”