#79422 - 2003-01-13 11:29 AM
FormatNumber() returns "" when value is 0
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
I am using KiX version 4.20 RC1 - however this occurs since version 4.11.
I want to return a number that has been formatted to 0 decimal places...
The following code ....
code:
? FormatNumber(1234567, 0, 0, False, -2) ? FormatNumber(1234, 0, 0, False, -2) ? FormatNumber(1, 0, 0, False, -2)
returns quote: 1,234,567 1,234 1
Which is what I would expect...
However...
code:
? FormatNumber(0, 0, 0, False, -2)
returns an empty string.
I had hoped that FormatNumber would have returned "0".
Lee
|
|
Top
|
|
|
|
#79423 - 2003-01-18 11:29 PM
Re: FormatNumber() returns "" when value is 0
|
Anonymous
Anonymous
Unregistered
|
Hi Lee,
the behaviour you report is the way it was designed. I agree that one can argue about the correctness, but the main reason it works the way it does is because it is compatible with Visual Basic.
Let me know what you think.
Regards,
Ruud
|
|
Top
|
|
|
|
#79424 - 2003-01-20 10:40 AM
Re: FormatNumber() returns "" when value is 0
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
Ruud,
Many thanks for your reply.
I have just wrote the following VBScript...
code:
WScript.Echo FormatNumber(0,0)
and found that this did return "0".
I realise that this is VBScript, which maybe different from VisualBASIC itself. Unfortunately I don't have a copy of VisualBASIC to try this on.
My personal view is that KiX should return "0" in this situation - however, I must admit that before I posted my original post I didn't attempt to test this with VisualBASIC.
Lee
|
|
Top
|
|
|
|
#79425 - 2003-01-22 02:15 PM
Re: FormatNumber() returns "" when value is 0
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
I must be having one of my dull moments! I really don't know what happened during my testing - but something fundamental broke down.
I cannot find a problem either.
Sorry for wasting everyones time!
Lee
|
|
Top
|
|
|
|
#79427 - 2003-01-22 03:09 PM
Re: FormatNumber() returns "" when value is 0
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
Cheers Jochen,
My original post was dated 13th Jan...I can't believe kixtart.org's regulars didn't pick me up on my mistake earlier - you guys are usually on the ball!
Don't get me wrong, I'm not trying to blame my mistake on everyone else - honest!!!
Lee
|
|
Top
|
|
|
|
#79429 - 2003-01-22 03:17 PM
Re: FormatNumber() returns "" when value is 0
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
Oh yeah, I forgot that!
Yeah, it's all your fault!!!
You made me look a fool!
Lee
|
|
Top
|
|
|
|
Moderator: ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1607 anonymous users online.
|
|
|