andyhill Posted August 2, 2020 Share Posted August 2, 2020 Without using an Editor can we round float columns to 2 decimal places ? If we have to use an Editor then I still need to round float value to 2 decimal places - Please show how to implement ? Do we use something like this and how do we apply it in code:- applyValue: function(value) { value = parseFloat(value); if (isNaN(value) || value === null) { value = this.getDefaultValue(); } //round the value to 1 decimal value = Math.round(value * 100) / 100; return this.callParent([value]); }, Link to comment Share on other sites More sharing options...
andyhill Posted August 2, 2020 Author Share Posted August 2, 2020 How do we use this in Delphi ? editor: new Ed(new fm.NumberField({allowBlank: false,allowNegative: false,maxValue: 10, decimalPrecision: 3})) Link to comment Share on other sites More sharing options...
andyhill Posted August 3, 2020 Author Share Posted August 3, 2020 My hidden panels are filled with hundreds of editors, there must be a better way. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now