Decimal fields truncate trailing zeroes?

Not applicable

I have created a form with several decimal fields that I want to be formatted as #.##

However, upon save to the database table, the traling zeroes are removed. For example, 1.00 gets set to 1. And 2.50 gets set to 2.5. I would like for all of my numbers to have a certain precision so they line up when displayed in a list. I reviewed the forum and tried the scale=2 suggestion, but that doesn't work. I created a client script that take the field and formats it as #.## using JavaScript. However, as soon as the record is saved, the trailing zeroes/formatting are removed.

Any idea on how to do this or if it's possible?

Thanks!

10 REPLIES 10

leonverster
Kilo Contributor

Hi, there.



Had the same challenge showing decimal 'zeros', e.g. show '50.00' in stead of '50'. I used the 'Price' field type which is a decimal field with an additional drop-down for currencies... In my case the decimal field is actually a 'monetary' value and therefore works for me. Could probably also use the currency field. Not sure how to solve this for a generic 'decimal' field.