Jump to content

DBGrid Column Float Round To 2 Decimal Places


andyhill

Recommended Posts

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...