Numberformat Field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Daross
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 23
Joined: Thu Jun 04, 2009 8:15 pm

Numberformat Field

Post by Daross » Sat Jun 06, 2009 5:46 pm

Hi all
I'm trying to convert my spreadsheet programs to Revolution.
I have a problem to setting numberformat into field "results" (I need format #.##0;-#.##0 the same in the spreadsheet)
My Rev stack is composed as follows: field "a" - field "b" - field "results"-
button "Enter"

Code: Select all

[b]Button "Enter"[/b]
on mouse up
put fld "a" * fld "b" into fld "results"
end mouseup

[code] [b]field "results"[/b]
on field
set numberformat to me to "#.##0;-#.##0"
end field
where is the 'error?

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sat Jun 06, 2009 6:19 pm

Buona sera Daross,

"the numberformat" is not a property of a field, but a local (script) property.

You need to set it before you do your computing:

Code: Select all

on mouse up 
  set the numberformat to "#.###"
  put fld "a" * fld "b" into fld "results" 
end mouseup 
Check "numberformat" in the docs and see also "format".


Best

Klaus

Daross
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 23
Joined: Thu Jun 04, 2009 8:15 pm

Post by Daross » Sat Jun 06, 2009 8:33 pm

Hi Klaus,
your script works!
Very very thanks!
________________
Ciao
Davide

Post Reply