I want to round a number to 2 decimal places in SAPUI5. Could anyone help?

SAP HANASAPSAP Basis

RoundingMode function is used for rounding the number and it uses these parameters: number and how many decimal digits.

Example

You can roundoff and your code will be like this:

<Input value="{
   path: 'helloPanel>/recipient/amount',
   type: 'sap.ui.model.type.Float',
   formatOptions: {
      maxFractionDigits: 2,
      roundingMode: 'away_from_zero'
   }
}"/>


raja
Updated on 17-Dec-2019 07:17:07

Advertisements