Displaying money values

Results 1 to 2 of 2

Thread: Displaying money values

  1. #1
    Join Date
    Dec 1969

    Default Displaying money values

    Is there an FAQ about how to use the data of the money datatype using SQL Server and ASP? I use an regular expression to check the format of the data coming in. This is what I currently use:<BR><BR>$?((d{0,3},)(d{3},)*d{3})&#124(d+)(.d{ 2})?<BR><BR>It works well, but now I&#039;m trying to figure out what to do. Do I use server-side script to take out any formatting the user might enter so that "$400,000" will be converted to "400000" and then place that into the SQL database with the datatype set to money, OR does the money datatype do that for me automatically?]<BR><BR>And then I&#039;m also interested about how the money datatype should be used when returning values from the database? What do I do to format it so that the user sees the value as something like "$400,000"?<BR><BR>Thx

  2. #2
    Join Date
    Dec 1969

    Default RE: Displaying money values

    2. FormatCurrency() <BR>1. Use IsNumeric(), find a dollar sign in the first char if necessary, and do a CDbl() on the value. That&#039;ll ditch your commas (I&#039;m not sure what CDbl() will do with a $ in there, you may want to try that first)

Posting Permissions

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