• Resolved lighttherapyoptions

    (@lighttherapyoptions)


    We are trying to enter dollars/cents and decimals, for example, .5 – into the numeric field with no success. It keeps saying, “enter a valid value.”
    I’m sure I am missing something obvious. Any help would be appreciated!
    Thank you!
    Louanna

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Yes, that’s correct, numeric fields are generally for integers only. If you want to change the numeric format that the field accepts, you need to modify the database directly, using phpMyAdmin or similar. Change the datatype of the field from BIGINT to DECIMAL (4,2) …the first digit is the number pf places before the decimal point, so set that as needed.

    • This reply was modified 7 years, 6 months ago by xnau webdesign. Reason: oops...meant bigint
    Plugin Author xnau webdesign

    (@xnau)

    Oh, and of course units or dollar signs, etc. won’t be allowed.

    Plugin Author xnau webdesign

    (@xnau)

    OH, and one more thing (I really gotta write this up as a tutorial!) you will want to give your numeric field a “step” attribute. In the manage database fields page, in the definition for your field where you want dollars and cents, put

    step::0.01

    in the “values” parameter. That will set the field to an increments of cents, rather than dollars, and the decimal will be accepted.

    Plugin Author xnau webdesign

    (@xnau)

    I just published a tutorial on making this kind of change, should be clearer than my posts here.

    Setting Up a Currency or Other Decimal-Type Field

    Thread Starter lighttherapyoptions

    (@lighttherapyoptions)

    Hello,
    Thank you so much for making yourself available to support this plugin.
    I was able to follow your directions and I made the updates and it’s accepting decimal input now.
    Thanks again!
    Louanna

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Numeric field not accepting decimals’ is closed to new replies.