Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > FormatNumber

Reply
Thread Tools

FormatNumber

 
 
MiniEggs
Guest
Posts: n/a
 
      12-04-2009
Hi

Why would FormatNumber(1,2,0,0,0) return 1,00 instead of 1.00 ?

All docs I've found on the web suggest it should return 1.00

Thanks in advance


 
Reply With Quote
 
 
 
 
Tim Slattery
Guest
Posts: n/a
 
      12-04-2009
"MiniEggs" <> wrote:

>Hi
>
>Why would FormatNumber(1,2,0,0,0) return 1,00 instead of 1.00 ?


Check the "Regional and Language Options" control panel applet on the
server, that's what controls this. Europeans use a comma to separate
the fraction from the integer, the US uses a period. You probably want
to set the region to "English, United States".

--
Tim Slattery

http://members.cox.net/slatteryt
 
Reply With Quote
 
 
 
 
MiniEggs
Guest
Posts: n/a
 
      12-04-2009
Hi Tim

Thanks for the reply

I have asked for this to be checked

The odd thing is though all three of these return the same result

Response.Write FormatNumber(1,2,-2,-2,-2)
Response.Write FormatNumber(1,2,-1,-1,-1)
Response.Write FormatNumber(1,2,0,0,0)

I would have thought 0 should mean the regional settings are ignored ?

Thanks

"Tim Slattery" <> wrote in message
news:...
> "MiniEggs" <> wrote:
>
>>Hi
>>
>>Why would FormatNumber(1,2,0,0,0) return 1,00 instead of 1.00 ?

>
> Check the "Regional and Language Options" control panel applet on the
> server, that's what controls this. Europeans use a comma to separate
> the fraction from the integer, the US uses a period. You probably want
> to set the region to "English, United States".
>
> --
> Tim Slattery
>
> http://members.cox.net/slatteryt



 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      12-04-2009
Tim Slattery wrote:
> "MiniEggs" <> wrote:
>
>> Hi
>>
>> Why would FormatNumber(1,2,0,0,0) return 1,00 instead of 1.00 ?

>
> Check the "Regional and Language Options" control panel applet on the
> server, that's what controls this. Europeans use a comma to separate
> the fraction from the integer, the US uses a period. You probably want
> to set the region to "English, United States".
>

One gotcha here is that the user profile whose Regional Settings are
manifesting in ASP might not be the user profile under which you are
logging into the server to check the Regional Settings. It might be the
IUSR account depending on how the website is configured. There are
several KB articles that deal with this issue so let me point you at
these search results:
http://www.google.com/search?sourcei...crosoft%2ecom+

--
HTH,
Bob Barrows


 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      12-04-2009
No. None of these arguments affects the decimal separator used. The last
argument will affect the thousands separator, but that's it.
I try to avoid formatnumber, formatdate and formatcurrency, for these
reasons. If I need to format a string, I do it explicitly. See
http://www.aspfaq.com/show.asp?id=2313 for some suggestions.

MiniEggs wrote:
> Hi Tim
>
> Thanks for the reply
>
> I have asked for this to be checked
>
> The odd thing is though all three of these return the same result
>
> Response.Write FormatNumber(1,2,-2,-2,-2)
> Response.Write FormatNumber(1,2,-1,-1,-1)
> Response.Write FormatNumber(1,2,0,0,0)
>
> I would have thought 0 should mean the regional settings are ignored ?
>
> Thanks
>
> "Tim Slattery" <> wrote in message
> news:...
>> "MiniEggs" <> wrote:
>>
>>> Hi
>>>
>>> Why would FormatNumber(1,2,0,0,0) return 1,00 instead of 1.00 ?

>>
>> Check the "Regional and Language Options" control panel applet on the
>> server, that's what controls this. Europeans use a comma to separate
>> the fraction from the integer, the US uses a period. You probably
>> want to set the region to "English, United States".
>>
>> --
>> Tim Slattery
>>
>> http://members.cox.net/slatteryt


--
HTH,
Bob Barrows


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error with FormatNumber sentence Lakrom ASP General 4 12-16-2004 07:03 PM
formatnumber function returns error eddie wang ASP General 11 02-11-2004 08:45 PM
Wrong syntax for formatNumber() ? I'm stuck. Greg Javascript 3 09-14-2003 05:02 PM



Advertisments
 



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