Format numbers to display all precisions

Posted by: weide.zhu on 29 March 2022, 9:00 pm EST

    • Post Options:
    • Link

    Posted 29 March 2022, 9:00 pm EST

    the number is always rounded on UI, given below an example.

    user types: 12.03546, UI displays 12.04 (we want to show all precisions, in this case, 12.03546)

    user types: 0.25, UI displays 0.25

    The issue here is that the precisions is dynamic, like for one row, it could be 2 decimals, for the others, it is 10 decimals.

    <wj-flex-grid-column [header]=“‘Risk Factor Value’” [binding]=“‘riskFactorValue’” [dataType]=2 [format]=“‘n2’” [isRequired]=“true” [width]=“150”>

    note the following work-around works:

    <wj-flex-grid-column [header]=“‘Risk Factor Value’” [binding]=“‘riskFactorValue’” [dataType]=2 [format]=“‘n2’” [isRequired]=“true” [width]=“150”>

    <ng-template wjFlexGridCellTemplate [cellType]=“‘Cell’” let-item=“item”>

    {{item.riskFactorValue}}



  • Posted 30 March 2022, 1:26 am EST

    Hi weide,

    You can either keep using the same workaround, or you can set the format to G10 (with thousand separators like n format) or g10 (without thousand separators). This format will automatically remove any trailing zeros therefore all the values will be displayed as it is up to 10 decimal places. You can also increase the number of decimals displayed up to 15.

    Regards,

    Ashwin

  • Posted 11 April 2022, 3:12 am EST

    that is great!

    ‘g15’ seems to be working fine, thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels