formatting

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
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

formatting

Post by Glenn Boyce » Mon Oct 20, 2008 9:04 pm

How do I set the numberfunction for dollars to have a comma between thousands i.e. 10,000,000.00

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Oct 20, 2008 10:24 pm

I haven't tested it, but this script might help:

http://thread.gmane.org/gmane.comp.ide. ... .user/1599

I don't believe you can do this (easily) with format or numberFormat.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

novarcproducts
Posts: 13
Joined: Fri Oct 05, 2007 12:45 am

Post by novarcproducts » Tue Jan 27, 2009 2:03 am

Hello Mark,
the function linked above works very well for a "Ask" & "Answer" senario.
Can you tell me what the "Mouseup" script would be to retrieve the number to be converted from a field without using the "Ask" or "answer" commands? Sorry for such a simplistic question.
Thanks,
Ron

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Jan 27, 2009 10:05 am

Hi Ron,

Your script would look like this:

Code: Select all

on mouseUp
 put fld "Some Number" into myNumberVar
  if myNumberVar <> "" then put "$"&dispnum(true,myNumberVar) into fld "Another Number"
end mouseUp
Best,

Mark
Last edited by Mark on Wed Jan 28, 2009 12:57 pm, edited 1 time in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

novarcproducts
Posts: 13
Joined: Fri Oct 05, 2007 12:45 am

Post by novarcproducts » Wed Jan 28, 2009 4:21 am

Thanks Mark.
Your help is very much appreciated,
Ron

Post Reply