How to save a decimal value and make it round off to the desired value on a list view
Objective
This article is for users that would like to change their decimal data type to round off to their desired "rounding off value," as the value gets saved to the list view / back end database.
The K2 application provides two decimal places by default when the decimal SmartObject property is created.
Before You Begin
This KB is meant to provide the solution for K2 users running K2 Five. However, an additional solution/alternative is provided to also cover K2 users running K2 blackpearl 4.7.
How-to Steps
In K2 Five, you can specify your desired rounding off when creating the SmartObject properties for the decimal data type as depicted below. This is still editable even after the views and forms are already generated.
The rounding off is only applicable to SmartBox SmartObjects and no other Service Types.
The decimal places only apply to SmartBox SmartObject properties.
In K2 blackpearl 4.7 you will need to do the following:
1. Create a custom database2. In a datatype decimal specify the desired rounding off value3. Create an SQL service instance4. Connect your SmartObject to your custom database.