Truncate decimals without rounding

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Ruprecht
Normal user
Posts: 18
Joined: 04 Nov 2016, 10:02
Location: im Süden von DE

Truncate decimals without rounding

#1 Post by Ruprecht » 19 Dec 2020, 10:39

I am looking for a function / rule which cuts off the decimals from a number without rounding

Code: Select all

Let,1,[BME280#Temp]
NeopixelLine,[int#1#D0],30,10,10,10
Temp = 8.3 it shows 8 --> OK
Temp = 8.7 it shows 9 ??

User avatar
Ath
Normal user
Posts: 3549
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Truncate decimals without rounding

#2 Post by Ath » 19 Dec 2020, 10:48

Have you tried the Floor formatting option? (F instead of D0)
/Ton (PayPal.me)

Ruprecht
Normal user
Posts: 18
Joined: 04 Nov 2016, 10:02
Location: im Süden von DE

Re: Truncate decimals without rounding

#3 Post by Ruprecht » 19 Dec 2020, 15:25

Ath wrote: 19 Dec 2020, 10:48 Have you tried the Floor formatting option? (F instead of D0)
Oh, thanks very much. This works.
Sometimes i can't see the forest in front of trees :)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests