Round in codeless

Hi
how can i round float to the first decimal?
for example 12.215544785
i want it to be 12.2
like Number.toFixed() in js

Hi @mohammad_altoiher,

Please see below:

i did try that but it return to 12 not 12.2

what about multiple it by 10 then round and finally divide it by 10?

i will try that
it seems a lot of work tho.
it will be nice to implement the toFixed function if possible in the future

Is there still no native way to do decimals rounding, preferably with a given number of decimals to round to, in Backendless @vladimir-upirov ?

Asking since this is an old message, but I cannot find a direct solution without using custom code blocks or more creative math like you suggested here.

I have created my own little function do do this for me. Sharing here in case it will help someone else:

Hello @Egil_Helland

Yes, there is no such block.
However, you can actually use raw code or your own little function to achieve this goal.

Regards,
Vladimir

1 Like