Number FORMAT showing perfect, but inserted wrong on DB (CALCULATED FIELD)

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
sario
Posts: 9
Joined: 2020-05-03 08:35

Number FORMAT showing perfect, but inserted wrong on DB (CALCULATED FIELD)

Post by sario » 2021-04-27 17:44

Hi. When I want the number format, I use the "CALCULATED FIELD" such as this query on subtotal field with DECIMAL data type and precision 2 :

Code: Select all

SELECT FORMAT(subtotal,2) FROM orders WHERE orders_id = %ID%
So, here is the bug :
the TV and DV both is showing 30,000.00 (correct). But the database is inserted as 30 only.

Another example, TV dan DV is showing 643,500.00. But when I check the DB using phpmyadmin, it's only inserted as 643.

Here is another example :
- Showing 1,632,000.00 only inserted as 1 on DB
- Showing 1,120,000.00 only inserted as 1 on DB
- Showing 51,000,000.00 only inserted as 51 on DB
- Showing 5,499,999.00 only inserted as 5 on DB

so the behavior is the first number before comma only is inputed to database while the rest is missing. When I refresh the page, the first value is showing just like the value that inserted on DB example 30. And when it's triggered by the CALCULATED FIELD, it turn into 30,123 (the correct value is showing). But the inserted DB still 30 only.

When I use this kind of query :

Code: Select all

SELECT subtotal FROM orders WHERE orders_id = %ID%
it's working perfectly. the displayed value and the inserted value on DB is match and correct. but without any numbering format.

I have tried a lot of way to solve this problem, but got no luck. Really wish someone can help me here. Thanks.

If someone need to investigate this error, please let me know, I'm willing to pay someone's service to fix this if needed. Thanks all.

NB :
- my appgini version is 5.94 revision 1132
- my DB version is :
Server: 127.0.0.1 via TCP/IP
Jenis server: MariaDB
Koneksi server: SSL sedang tidak digunakan Dokumentasi
Versi server: 10.4.11-MariaDB - mariadb.org binary distribution
Versi protokol: 10
Pengguna: root@localhost
Kumpulan karakter server: UTF-8 Unicode (utf8mb4)

-My Web Server is :
Apache/2.4.43 (Win64) OpenSSL/1.1.1f PHP/7.4.4
Versi klien basis data: libmysql - mysqlnd 7.4.4
Ekstensi PHP: mysqli Dokumentasi curl Dokumentasi mbstring Dokumentasi
Versi PHP: 7.4.4

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Number FORMAT showing perfect, but inserted wrong on DB (CALCULATED FIELD)

Post by pbottcher » 2021-04-27 21:39

Hi,

do you need the calculated field?

There is a similar thread

viewtopic.php?f=11&t=4297&sid=a8765c3ca ... 208b5b535b

maybe that helps
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

sario
Posts: 9
Joined: 2020-05-03 08:35

Re: Number FORMAT showing perfect, but inserted wrong on DB (CALCULATED FIELD)

Post by sario » 2021-04-28 05:45

It seems that the case is little bit different (CMIIW).
I need the numbering format using calculated field.
In my case, the number after comma (,) is not inserted on database. it's just missing. When the number is expected to be 1,234.56, the inserted on database is only 1.

While the case on this viewtopic.php?f=11&t=4297&sid=a8765c3ca ... 208b5b535b is recognize as wrong recognition of dot and comma if my understanding is right.

sario
Posts: 9
Joined: 2020-05-03 08:35

Re: Number FORMAT showing perfect, but inserted wrong on DB (CALCULATED FIELD)

Post by sario » 2021-04-28 13:28

I have try : https://appgini.bizzworxx.de/webdevelop ... ql-php-js/ and Fields that have a data format specifie ... n instead) that said
Fields that have a data format specified (you can apply a data format in the calculation instead)
. None of them working well. I'm good to using any kind of numbering format. such as 1,234.00 or 1.234,00
I have tried both numbering format. it shows prefectly on TV and DV, but after I check the DB, it's only inserted the 1 value.

Really need help. It's so strange. I'm willing to pay if someone could offer me his service to fix this. Thanks a lot.

Post Reply