Skip to content

Instantly share code, notes, and snippets.

@orangexception
Created August 6, 2012 19:40
Show Gist options
  • Save orangexception/3277875 to your computer and use it in GitHub Desktop.
Save orangexception/3277875 to your computer and use it in GitHub Desktop.
CTXNumberFormat
function CTXNumberFormat( dNumber ) {
dNumber= DecimalFormat( dNumber );
dNumber= dNumber.ReplaceAll( "(\.0+|\.(\d)0)$" , ".$2" );
dNumber= dNumber.ReplaceAll( "," , "" );
dNumber= dNumber.ReplaceAll( "\.$" , "" );
dNumber= dNumber.ReplaceAll( "^0+" , "" );
return dNumber;
}
@orangexception
Copy link
Author

4+ digit numbers were including commas. I added a line to remove those as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment