Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
Saving Rounded Decimal Values in DataSource
posted

Hello,

I have a decimal column which I format using the column.format to 2 decimal places. I can see that this changes the text but not the underlying value. What

is the best way to round the underlying value? My database is crashing trying to save too many decimal places.

Do I have to use the IEditorDataFilter?

regards

 

Darren

Parents
No Data
Reply
  • 48586
    posted

    Hello Darren,

     

    What database are you using? Microsoft SQL Server automatically rounding decimal value, when scale of value is more than scale of the column. So your database shouldn’t be “crashing” if you are synchronize  the type of what you insert with database type of the column where you insert.

    If you want to rounding value of the cell you could use _BeforeCellUpdate event of the grid, and round cell value depends on your requirements.

     

    Let me know if you have any further questions.

Children