Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FormatNumber

1 view
Skip to first unread message

MiniEggs

unread,
Dec 4, 2009, 7:33:44 AM12/4/09
to
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


Tim Slattery

unread,
Dec 4, 2009, 8:39:57 AM12/4/09
to
"MiniEggs" <b...@a.com> 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
Slatt...@bls.gov
http://members.cox.net/slatteryt

MiniEggs

unread,
Dec 4, 2009, 8:59:06 AM12/4/09
to
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" <Slatt...@bls.gov> wrote in message
news:u44ih55mtnojbrtuo...@4ax.com...

Bob Barrows

unread,
Dec 4, 2009, 9:11:25 AM12/4/09
to
Tim Slattery wrote:
> "MiniEggs" <b...@a.com> 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?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD:2003-36,GGLD:en&q=%22Regional+Settings%22+IIS+ASP+site%3asupport%2emicrosoft%2ecom+

--
HTH,
Bob Barrows


Bob Barrows

unread,
Dec 4, 2009, 9:35:01 AM12/4/09
to
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.

--
HTH,
Bob Barrows


0 new messages