Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formatnumber messing up my figures

Status
Not open for further replies.

tyutghf

Technical User
Apr 12, 2008
258
GB
I have a number in a database with 1 decimal place

i.e. 7.4

I need to display on the oage with 2 decimals

i.e. 7.40

So I use formatnumber(rs("number"),2) but I am getting

74,00

There are two problems with this

a. decimal point is in the wrong place, making the figure 10x what it should be
b. why is the decimal now a comma(,) instead of a period(.)?

Anyone know what the issue is?
 
Sounds to me like a language issue.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
The switch to comma (,) as decimal separator is related to the default to use the computer's regional settings when 3th to 5th arguments are absent; that means probably the server is of continental regional settings.

As to 7.4 becoming 74, make sure your announcement is correct (rs("number") being "7.4" or 7.4). If you test it like:
[tt] ccur(rs("number").value)[/tt]
and the result persists, you better report to ms as bug: because there is no reason for formatnumber() to be of such behaviour. (I don't believe one bit.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top