|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1001 |
Negative number display problem |
03/12/2004 @ 21:13 by Chuck
|
Negative numbers between 0.0 and -1.0 do not display with a minus sign. All negative numbers greater than or equal to -1.0 display properly. The following code will show the problem: P=0.45 N=-0.67 N$="P= " + STR$(P,2) N$=N$+" N= "+STR$(N,2) I=MESSAGEBOX(N$,1) Both P and N will show as positive numbers on screen. All calculations seem to operate properly. It is just a display issue. UPDATEFIELD has the same display problem.
Any ideas?
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 03/12/2004 @ 21:40 by Chuck
visitor |
In thinking about this some more, the STR$ function was common to all of my display problems. I suspect that the STR$ function is the source of the issue. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 03/12/2004 @ 22:48 by aldweb
visitor |
Hi Chuck,
I will check the STR$ function. Indeed, I think that I only tested it with positive numbers! You are going to be nominated Top iziBasic Bug Finder, together with our friend gmigueis!
But, for the NUMFIELD, it is normal that it accepts only positive values, this is a Palm OS restriction, not an iziBasic one...
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 05/12/2004 @ 05:49 by Chuck
visitor |
While NUMFIELD does not allow entry of negative numbers, it does display them just fine when I use the UPDATEFIELD command. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4 -------- 05/12/2004 @ 12:54 by aldweb
visitor |
OK, Chuck, good point for you and I might very well be wrong then! I will check the overall running of this NUMFIELD object.
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 5 -------- 05/12/2004 @ 16:56 by Chuck
visitor |
Just to be clear, I have displayed negative numbers in a numfield, but I have never tried reading them back from the screen. It may indeed have the same limitation as entering negative numbers from the graffiti pad.
In my application, the negative numbers are a baseline credit that is not allowed to be changed. I display them, but ignore changes, so I don't know what would happen if I read them back from a NUMFIELD. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 6 -------- 05/12/2004 @ 20:59 by aldweb
visitor |
Hi Chuck,
I've tested and would you be so kind to tell me if you confirm my findings.
[-1.0] works fine with me. So, I believe that the problem only occurs with [-0.xx] values! And also when doing STR$(A,n) with n>=0 (if n<0, display is correct).
Now, I have to dig into the source code of iziBasic...
As for the NUMFIELD issue, here is a copy & paste of Palm OS API doc: If checked, only the characters 0 through 9 and associated separators are allowed to be entered in the field. The associated separators are the thousands separator and the decimal character. The values of these two characters depend on the settings in the Formats prefs panel.
So, it seems that the minus sign really is not taken into account when the user keys in one number, as I thought until now. And your own test have proven that someone could force displaying a minus sign in a field anyway! But it has to be by programming...
Cheers,
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 7 -------- 06/12/2004 @ 15:51 by Chuck
visitor |
You are correct that the problem is only with -0.xx values. My application is using money values, so it is always STR$(A,2) |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|