Jump to content

Recommended Posts

Posted

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]);
    },

 

Posted

How do we use this in Delphi ?

editor: new Ed(new fm.NumberField({allowBlank: false,allowNegative: false,maxValue: 10, decimalPrecision: 3})) 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...