|
- Forum
- iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1001 |
Negative number display problem |
le 03/12/2004 @ 21:13 par Chuck
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
|
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
Réponse n° 1 -------- le 03/12/2004 @ 21:40 par Chuck
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
visiteur |
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. |
|
![Haut Haut](inc/img/general/haut.gif) |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 03/12/2004 @ 22:48 par aldweb
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
visiteur |
Hi Chuck,
I will check the STR$ function. Indeed, I think that I only tested it with positive numbers! ![](inc/img/smileys/rolleyes.gif) You are going to be nominated Top iziBasic Bug Finder, together with our friend gmigueis! ![](inc/img/smileys/cool.gif)
But, for the NUMFIELD, it is normal that it accepts only positive values, this is a Palm OS restriction, not an iziBasic one... ![](inc/img/smileys/frown.gif)
@+ aldweb |
|
![Haut Haut](inc/img/general/haut.gif) |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 05/12/2004 @ 05:49 par Chuck
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
visiteur |
While NUMFIELD does not allow entry of negative numbers, it does display them just fine when I use the UPDATEFIELD command. |
|
![Haut Haut](inc/img/general/haut.gif) |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4 -------- le 05/12/2004 @ 12:54 par aldweb
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
visiteur |
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 |
|
![Haut Haut](inc/img/general/haut.gif) |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 5 -------- le 05/12/2004 @ 16:56 par Chuck
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
visiteur |
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. |
|
![Haut Haut](inc/img/general/haut.gif) |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 6 -------- le 05/12/2004 @ 20:59 par aldweb
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
visiteur |
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 |
|
![Haut Haut](inc/img/general/haut.gif) |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 7 -------- le 06/12/2004 @ 15:51 par Chuck
![Anonyme Anonyme](inc/img/avatars/unknow.gif)
visiteur |
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) |
|
![Haut Haut](inc/img/general/haut.gif) |
![actif](inc/img/general/msg_a.gif) sujet actif
![clos](inc/img/general/msg_c.gif) sujet clos
![Important!](inc/img/general/msg_t.gif) Important!
![Nouveau](inc/img/general/msg_n.gif) Nouveau message -
![Rectifier](inc/img/general/edit.gif) Rectifier message
![Clôturer](inc/img/general/lock.gif) Clôturer sujet
![Remonter](inc/img/general/lockup.gif) Remonter
|
|