Title: Decimal Fields Changing Upon Save
Last modified: June 3, 2017

---

# Decimal Fields Changing Upon Save

 *  [lighttherapyoptions](https://wordpress.org/support/users/lighttherapyoptions/)
 * (@lighttherapyoptions)
 * [9 years ago](https://wordpress.org/support/topic/decimal-fields-changing-upon-save/)
 * Hello,
    I have a few fields set to accept Decimal input according to your instructions
   earlier.
 * The field is “Warranty”. In the database, it is set to decimal (2,2).
 * In the plugin, the field is set to Numeric – step::0.01
 * When we enter .5, it accepts .5.
    If we enter .25, it accepts .25.
 * If we enter and whole number, it changes it to .99 upon save.
 * We are having this is issue with other decimal fields, too.
 * I must have something set wrong?
 * Many thanks for your help.
 * Louanna

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [lighttherapyoptions](https://wordpress.org/support/users/lighttherapyoptions/)
 * (@lighttherapyoptions)
 * [9 years ago](https://wordpress.org/support/topic/decimal-fields-changing-upon-save/#post-9193928)
 * Another field set to decimal 4,2 will not accept a number over 99.99.
 * In another issue, I have set the price field to Decimal 6,2 in the database repeatedly
   and it keeps changing itself back to bigint20.
 * I am wondering if the input needs to be decimal.
    It is numeric data, for sure.
   Most of it is decimal data. However, I don’t need to do math with it. I would
   like to be able to sort it in ascending and descending order, at least. If the
   data is not a number and we just put it in a text line, will it sort numerically?
 * Thanks again,
    Louanna
 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [9 years ago](https://wordpress.org/support/topic/decimal-fields-changing-upon-save/#post-9194725)
 * It appears I made a mistake. The values for defining a DECIMAL field in MySql
   are (total length, places after the decimal point) so the first value is not 
   the number of places before the decimal point.
 * So, if you want to store numbers up to 99.99, the configuration of the DECIMAL
   field should be (4,2)
 * Very sorry about that, but I learned something!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Decimal Fields Changing Upon Save’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

## Tags

 * [decimal](https://wordpress.org/support/topic-tag/decimal/)

 * 2 replies
 * 2 participants
 * Last reply from: [Roland Barker](https://wordpress.org/support/users/xnau/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/decimal-fields-changing-upon-save/#post-9194725)
 * Status: not resolved