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 » Fri May 22, 2015 11:18 pm

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 » Sat May 23, 2015 12:16 am

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: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: dropping the decimal values in a calculated field

Post by mwieder » Sat May 23, 2015 12:24 am

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 » Sat May 23, 2015 12:49 am

Thanks its working :D

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”