Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Geolocation, less decimals in readings.

Hi,

Are there a way to get less decimals on the gelocation callings? Here i have lat/long and height.

Image

Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Geolocation, less decimals in readings.

Also, is there an easy way to report adress?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Geolocation, less decimals in readings.

Hello,

Of course, you can reduce the decimals with a simple JS codeprevar a = 1.23456789;
var b = Math.round(a * 100) / 100;/pre
here you will get 1.23 value in the variable "b". You can control a number of digits by changing 100 to 1000 (you will get 1.234) and so on

Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Geolocation, less decimals in readings.

Thanks! And where do i implement this?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Geolocation, less decimals in readings.

Please add this code to the mapping your lattitude/longitude values to labels: https://docs.appery.io/docs/appbuilde...

Your code should be:prereturn Math.round(value * 100) / 100;/pre

Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Geolocation, less decimals in readings.

Thanks! Worked like a charm!

Return to “Issues”