dropping the decimal values in a calculated field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
mikemc
Posts: 60
Joined: Sun May 10, 2015 5:42 pm

dropping the decimal values in a calculated field

Post by mikemc »

I am dealing with large dollar values andI would like to just drop the decimal value in calculated fields 4.556 becomes 4
sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: dropping the decimal values in a calculated field

Post by sefrojones »

Code: Select all

on mouseup
   put 4.556 into MyDollarValue
   set the itemdelimiter to "."
   put item 1 of MyDollarValue
end mouseup
--Sefro
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3582
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: dropping the decimal values in a calculated field

Post by mwieder »

put trunc(4.556)
mikemc
Posts: 60
Joined: Sun May 10, 2015 5:42 pm

Re: dropping the decimal values in a calculated field

Post by mikemc »

Thanks its working :D
Post Reply