Sql Server and VBScript decimal problem

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Sql Server and VBScript decimal problem

    I am pulling a decimal value from SQL server and trying to use the format
    currency and format number function. I am using these values in a large
    string of HTML to be used in a CDONTS Email. If I use the code fragment
    below the price variable, which is 3.92 in the database, shows up as £392.
    When the formatcurrency is removed it is displayed as 3.92 but!!!! if I
    concatenate a "£" it displays £392. I have read some posts about VBscript
    not liking decimals, are there any ways around this. I have tried a
    conversion to the money datatype, used a variety of csng and cdbl functions.
    The odd thing is other numbers from the same column in the recordset format
    correctly. The other thing is that variable 'price' is used elsewhere and
    calculates correctly it seems VBscript just doesn't like converting it to a
    string. Totally stumped!! Can anyone help.

    HTML = HTML & "<td>" & formatcurrency(price) & "(&euro;" &
    formatnumber(price*rate,2) & ")" & "</td>"


    Chris Kennedy Guest

  2. Similar Questions and Discussions

    1. I?ve got a problem writing files on the server side withFlash Media Server 2.0.2 and 2.0.3.
      Hello, I?ve got a problem writing files on the server side with Flash Media Server 2.0.2 and 2.0.3. The same code was working fine with an older...
    2. InDesign "Decimal" problem Solved (e.g. 0.500500500500)
      Dear All, Please update your OS from 10.4.X to OS 10.4.8 directly from the net through software update from the Apple Menu. This will resolve the...
    3. RSS Feed Eater - VBScript Server Behaviour released
      Hi, I have just added my latest Dreamweaver extension to my website. It makes the task of consuming and displaying RSS feeds on ASP VBScript web...
    4. UltraSuite 7.5.5 for ASP/VBScript server model released!
      Friends, I would like to inform you that I have just released version 7.5.5 of UltraSuite for ASP/VBScript. The screenshots for this version...
    5. Testing Server problem: Server name or address couldnot be resolved!
      Not sure if this helps but I was going step by step in the Getting Started Experience Tutorial and when it got to the Database tab -- RDS Login...
  3. #2

    Default Re: Sql Server and VBScript decimal problem

    [url]http://www.aspfaq.com/5003[/url]

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "Chris Kennedy" <chrisknospam@cybase.co.uk> wrote in message
    news:eKOpTOieEHA.2396@TK2MSFTNGP11.phx.gbl...
    > I am pulling a decimal value from SQL server and trying to use the format
    > currency and format number function. I am using these values in a large
    > string of HTML to be used in a CDONTS Email. If I use the code fragment
    > below the price variable, which is 3.92 in the database, shows up as £392.
    > When the formatcurrency is removed it is displayed as 3.92 but!!!! if I
    > concatenate a "£" it displays £392. I have read some posts about VBscript
    > not liking decimals, are there any ways around this. I have tried a
    > conversion to the money datatype, used a variety of csng and cdbl
    functions.
    > The odd thing is other numbers from the same column in the recordset
    format
    > correctly. The other thing is that variable 'price' is used elsewhere and
    > calculates correctly it seems VBscript just doesn't like converting it to
    a
    > string. Totally stumped!! Can anyone help.
    >
    > HTML = HTML & "<td>" & formatcurrency(price) & "(&euro;" &
    > formatnumber(price*rate,2) & ")" & "</td>"
    >
    >

    Aaron [SQL Server MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139