What is your goal?
Hi, I have a output like this from my GPS module “Distance (km) 3.957679076993271” which then goes to a Set variable with this formula ( if(
{{268.Distance (km)}} < 1;
concat(round({{268.Distance (km)}} * 1000); " m");
concat(round({{268.Distance (km)}}; 1); " km")
)
then to a text agregator and then to my Http module to send to my clients but need this to be rounder of to 3.95km or if under a kilometer to meters
What is the problem & what have you tried?
It seems the Set variable formula is wrong
Error messages or input/output bundles
It just show the set variable message in my http message?
Screenshots (scenario flow, module settings, errors)
Hi, you’re hitting how round() works in Make. It always rounds to the nearest value, so something like 3.957 km won’t reliably give you 3.95 km. What you want here is to round down, not round normally. That’s where floor() helps.
Use that logic in your Set variable: meters for anything under 1 km, and kilometers trimmed to two decimals without rounding up. Once that’s in place, you can pass the variable to your aggregator or HTTP module and it’ll display exactly as expected.
Hope this helps.
Regards, Tony
Hey Brahm,
there is no concat() function in Make. Also your screenshot has text strings and not functions. Try selecting the functions from the menu instead to see the difference.
For future reference I suggest you don’t use AI to build your Make formulas → they are clueless and hallucinate stuff that doesn’t exist AND they don’t give you formulas that you can just copy/paste directly and all you get is text strings and not actual functions.
Again thanks for the support, as still learning what formula must I use?
Awesome thanks for the reply, as said still unsure what formula to use and can you help?
The same one you are using, just select it from the menu instead. And you don’t need concat, you can say it’s built in and you can just add the km afterwards.
Just to clarify, the functions do exist in Make, but they need to be inserted from the function picker, not typed as plain text. That’s usually where the confusion comes from when learning formulas.
The key idea is still the same: use floor() to avoid rounding up for kilometers, and normal rounding when converting to meters. Once you insert the functions from the menu, Make will treat them correctly and the formula will work as expected.
Hope that clears it up.
Regards, Tony