Welcome to Redline spacer spacer
Convert a Numeric Field into a Dollar Value
bar Jan 5, 2009
bar Home
bar Downloads
bar Privacy
bar Site Map
bar Search
bar  

 
Home > Toys > Here
 
spacer Contained within this page is a JavaScript utility to convert a given numeric value into a "dollar amount". In short, this converts

	-1721.38

to

	-$1,721.38

This function is based on the math routines available through your browser. Hence it is limited to dealing with values in the +- (2**32)-1 (typically) on most of the "newer" browsers.

Furthermore, int2dollars() has to additional arguments for prefixing and suffixing negative values (such as a <font...> tag to turn the value red). Within this script there is a function "doit()" that exemplifies the calling conventions. For the purposes of example, if you enter a negative value into the "number" field, the "doit()" invocation of int2dollars() will prepend and append an "x" to the value that will be written into the "dollars" field.

Enter a number here
See the dollars appear here
ICRA Logospacer
spacer
Fight Spam! Join CAUCE!
Motley Fool Money Advisor 05spacer
In Association with Amazon.com

frame bar
spacer Copyright ©
Roland Stolfa, 2009
All Rights Reserved
  [Home]    [Downloads]    [Writings]    [Crafts]    [Living]    [Family]    [Toys]    [Cryptography]    [Fun Links]    [Site Credits]    [Personal Info]    [Privacy]    [Site Map]    [Search]    [Email Me]    [Hosted By: Brinkster.Com]   
subliminal data collector