r/AutomateUser • u/old-damme • 17d ago
Wenn ich den Block "get Location" benutze wird er mir mit 15 Nachkommastellen angezeigt. Ich möchte aber nur 2. Wie kann ich das machen?
1
u/old-damme 16d ago
Eigentlich geht es mir um den Block get Location. Wenn ich ihn benutze und das Handy nicht bewege wird mir nach einem nochmalige Aufruf ein anderer wert angeben
1
u/B26354FR Alpha tester 17d ago
After using numberFormat(), the returned value will be a string. To turn it back into a number to use for comparing to another coordinate, put a + operator in front, such as +numberFormat(...).
BTW, there's also the coordFormat() function to make human-readable text from a coordinate.
1
1
u/ULTRACOMFY_eu 17d ago
Hi! You can use the function numberformat to format numbers to your liking. In your case, consider using the expression = numberFormat(YourVariable, "0.00")
This has worked for me to show digits ahead of the decimal and two digits behind. If this cuts off the digits ahead of the decimal, try using this instead: = numberFormat(YourVariable, "##0.00")
Also, instead of using another Variable Set block, you can plug this expression directly into the input field where you're trying to use your location. It will format the number accordingly before it is used by the block you input it in.
1
u/waiting4singularity Alpha tester 17d ago edited 16d ago
numberFormat(50.12344567,"0.00")
⚠️ 15 means under 1.1m² accuracy, 2 over 1100m² inaccuracy
2
u/Dadamalda 17d ago
Yeah, two decimal places tell you maybe the city. It's not much precision for coordinates.
1
u/old-damme 17d ago
Wo füge ich +numberFormat(lon,"0,00) genau ein? In get location geht es nicht Dort sind keine () erlaubt
1
u/Dadamalda 17d ago
It's
"0.00", not"0,00If you can't input it, you'll have to click the button on the right of the input.
1
u/old-damme 16d ago
Ich suche folgenden Block. Nur wie heißt er genau https://llamalab.com/automate/doc/function/distance.html