开发者

in freemarker while reading the data from the controller it is not displaying the exact value it is doing rounging why?

开发者 https://www.devze.com 2023-03-06 18:25 出处:网络
this is my code:-fixed ,variable salary are store in data base like:14.40 and 300.70 while displaying these value in ui it display like fixed ,variable salary 14,301 it is doing round method. how to g

this is my code:-fixed ,variable salary are store in data base like:14.40 and 300.70 while displaying these value in ui it display like fixed ,variable salary 14,301 it is doing round method. how to get exact value pzl any one.(em开发者_如何学GoployeeInfoForm)this is my obj contain all fields.

<tr>
    <th >Fixed salary:</th>
    <td>${(employeeInfoForm.fixedSalary)!'--'}</td> 

    <th >Variable Salary:</th>
    <td>${(employeeInfoForm.variableSalary)!'--'}</td>  
</tr>


Two things needed to keep in mind -

i) what are the types for employeeForm.fixedSalary and employeeForm.variableSalary? In other words, need to ensure that rounding does not happen before the value is fed in for replacement in template;

ii) check and see if number format is set in template, for e.g., <#setting number_format="0.##"> rounds to two decimal places

0

精彩评论

暂无评论...
验证码 换一张
取 消