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: Klaus, FourthWorld, heatherlaine, kevinmiller

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

Rounding a number in a field

Post by bqsbarbqGAnC5Z »

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 »

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 »

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