trailing zeroes not going into database

前端 未结 3 696
迷失自我
迷失自我 2021-01-22 10:38

So here is my issue, We are trying to put pricing into our database but for some reason it converts 10.00 to 10 OR 10.50 to 10.5 it keeps it just chops off the trailing zeroes..

3条回答
  •  孤街浪徒
    2021-01-22 11:14

    It doesn't matter how it looks in the database. What matters is how you present data in your app. 10.00 is the same value as 10, so in the data table it will be saved as 10.

    You have to format number before output.

提交回复
热议问题