Results 1 to 7 of 7

Thread: Formatting fields.....

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Formatting fields.....

    Hello,

    I am reading a record from a SQL DB which has the datatype set to "money". In my webpage (ASP) I now want to display this "money record" just read in the format 999,999,999.99.

    How can I do this??

    By just doing a response.write var it DOES show me the right value, but in the format 999999999 - also excluding the decimal!!

    Any help or suggestions please.

    Thanks,
    T

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Angry Come on....

    ....please help with this one!!

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    I think you can use the VBScript FormatCurrency() function...

    Syntax

    FormatCurrency(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])

    Check out this page on MSDN
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Question

    Hi Monte96,

    It works great except for one thing. The default currency symbol is $, and I would need to use something else!! Do you perhaps know how to change this?? I'll go look on MSDN too.

    Another thing is that I need to separate 1000's with a "," - eg 500,000.00.

    Thanks for your help,
    T

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343
    MSDN helps!! I got the answer on my question about seperating 1000's with ",", but I cannot see how to change the currency symbol.

    ANY help or ideas please!!

    T

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Cool Got it...

    Instead of using formatcurrency, I just use formatnumber in the same way. I then lose the currency sign, but thats ok.

    Thanks,
    T

  7. #7
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    The currency symbol used should be determined by the Regional Settings on the server...
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width