Groups | Blog | Home
all groups > dotnet jscript > july 2003 >

dotnet jscript : a script to add thousand seperators while user enters amount in a textbox


buran
7/29/2003 2:35:46 PM
Dear JScript Programmers,

I am looking for a script, which shall add thousand seperators while
entering amounts. Where can I find such a script?
Thanks in advance,

Buran

name
8/9/2003 5:23:31 AM
"seperators"


=

separators


--------

Won't help, I know



[quoted text, click to view]

Joe Fawcett
8/11/2003 8:48:03 AM

[quoted text, click to view]

function addCommas(Value)
{
var sValue = Value + "";
var oRE = /(\d)(?=(\d\d\d)+(?!\d))/g;
return (sValue.replace(oRE, "$1,"));
}

if you can use regular expressions.
--

Joe

AddThis Social Bookmark Button