Rounding a number in a 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
bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Rounding a number in a field

Post by bqsbarbqGAnC5Z » Fri Jun 08, 2012 5:37 am

Hi everyone,

I'm having trouble with using the round or trunc functions. I have a number in a field called numberfield and I can't seem to round it or truncate it and was wondering if anyone has any advice.

I tried using:
round(field "numberfield") and round field "numberfield"

and I did the same with trunc to no avail.

Any help would be greatly appreciated! Thank you!

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Rounding a number in a field

Post by shaosean » Fri Jun 08, 2012 5:47 am

round and trunc are both functions, so you need to do something with the returned data..

Code: Select all

put round(field "numberField") into field "numberField"

bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Re: Rounding a number in a field

Post by bqsbarbqGAnC5Z » Fri Jun 08, 2012 5:53 am

Oh wow, I completely overlooked that, I'm still pretty new to this stuff. Thanks shaosean!

Post Reply