Manipulating Text

Results 1 to 2 of 2

Thread: Manipulating Text

  1. #1
    Join Date
    Dec 1969

    Default Manipulating Text

    Hi Guys,<BR><BR>I have a number called numTotal and I want to put a comma after every 3 numbers, i.e. 2000000 to 2,000,000 etc..<BR><BR>I think the best way to do this is to convert numtext to a text String and then reverse it, count along 3 characters then add a comma, keep going till the end then reverse it again.<BR><BR>I&#039;m not too hot on the text manipulation functions so if anyone could help me by telling me the best functions for this I&#039;d be most greatful.<BR><BR>I have got as far as this:<BR>--------------------------------------------------------<BR><BR>Dim numTotal, strTotal<BR>numTotal = 2000000<BR><BR>strTotal = Cstr(numTotal)<BR> <BR>&#039;Missing the code to reverse it and add the commas the reverse it back...<BR><BR>&#039;This should write 2,000,000<BR>Response.Write strTotal<BR><BR>--------------------------------------------------------<BR><BR>Thanx for any help,<BR><BR>Jarvis

  2. #2
    Join Date
    Dec 1969

    Default Lookup the function FormatNumber <EOP>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts