BUG: When entering a price into a number field, Servoy is subtracting a penny! I enter 10.00 and 9.99 goes into the database. This field is a “number” field in Servoy, mapped to a “decimal (3,2)” field in mySQL 4.1.9. I have tried making the decimal field in mySQL “decimal (3,3)”, when I do this, the value that goes in is 9.999. I have also tried adding formatting to the field on the layout (#,###.00)
No luck.
I realize a penny is not much, but it is completely unacceptable to my customers. I am forced to go back to FileMaker to enter data. This defeats the reason I bough Servoy to begin with.
Config:
Machine Model: Power Mac G5
CPU Type: PowerPC G5 (2.2)
Number Of CPUs: 2
CPU Speed: 2 GHz
L2 Cache (per CPU): 512 KB
Memory: 2 GB
Bus Speed: 1 GHz
Boot ROM Version: 5.1.8f7
Serial Number: G84470HSQPR
System Software Overview:
System Version: Mac OS X 10.3.9 (7W98)
Kernel Version: Darwin 7.9.0
Boot Volume: MasDev_HD
Computer Name: MasDev Command Center
User Name: Mark A Suppes (marksuppes)
Servoy Developer
Version R2 2.2rc6-build 324
Java version 1.4.2-38 (Mac OS X)
MySQL 4.1.9-max-log
Mark A Suppes
MasDevelopment
Vice-President NY FileMaker Developers’ Group
I have a solution which uses Sybase for stock management. There is a method which adds stock items to a mysql database to drive a website. This includes prices. I saw your post and thought I’d check my solution. In my test, If I add 100.00, 100.00 goes into sybase, if I then execute the script to add the related mysql record, 100.00 goes into that (verified IN MySQL) I also tried with other arbitrary values… Simply because I have a similar solution, I was able to test this and can’t reproduce your problem (for reference, my machine specs are identical, a dual 2.0Ghz G5 running 10.3.9, Servoy 2.2rc6 AND my MySQL prices are formatted as decimal… Works perfect here. Must be something in your coding
as Thunder says, probably there must be something wrong in your code, I’ve got a lot of different Servoy solutions with different numeric fields and calculations.. and all of them works as expected, with NO unpredictable/unwanted penny discrepancy!!!
Thanks you for the feedback. Unfortunately, I am still having this problem. I don’t think this is a problem with “my coding” since there isn’t really any code going on here. It’s just a decimal (10,2) field in mySQL, with a servoy field mapped to it. There is no javascrip or anything like that. I am just using servoy as a front end for data entry.
I’ve noticed that the problem only happen with certain values, such as .09
for example, but not .07
Had a problem similar (but not identical) to this last year with MS SQL Server. (Problem involved a much higher precision.) Turned out to be the MS jdbc driver. Switched to the jtds driver and the problem went away.