Comma Seperator

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
saviour
Posts: 26
Joined: Wed Feb 05, 2014 5:11 am

Comma Seperator

Post by saviour » Sun May 07, 2017 3:51 pm

Hi there,

I searched the forum on the topic but could nt find the right one. How to enter number in a field which automatically inputs the number with comma in thousand separator format like 123,456,789 format??

Thanks :)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Comma Seperator

Post by jmburnod » Sun May 07, 2017 8:55 pm

Hi,
not sure that is the best way but quickly :

Code: Select all

...
   put "123456789" into t
   put empty into t2
   repeat until t = empty
      put char -3 to -1 of t & cr before t2
      delete char -3 to -1 of t
   end repeat
   delete char -1 of t2
   replace cr with "," in t2
   put t2
...
Best regards
Jean-Marc
https://alternatic.ch

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Comma Seperator

Post by SparkOut » Sun May 07, 2017 10:18 pm

Therr are some threads that discuss the possible approaches, such as http://forums.livecode.com/phpBB2/viewt ... 696#p12696

Post Reply