@@ -72,49 +72,49 @@ sap.ui.define([
72
72
* @public
73
73
* @type {string }
74
74
*/
75
- FLOOR : "floor " ,
75
+ FLOOR : "FLOOR " ,
76
76
/**
77
77
* Rounding mode to round towards positive infinity
78
78
* @public
79
79
* @type {string }
80
80
*/
81
- CEILING : "ceiling " ,
81
+ CEILING : "CEILING " ,
82
82
/**
83
83
* Rounding mode to round towards zero
84
84
* @public
85
85
* @type {string }
86
86
*/
87
- TOWARDS_ZERO : "towards_zero " ,
87
+ TOWARDS_ZERO : "TOWARDS_ZERO " ,
88
88
/**
89
89
* Rounding mode to round away from zero
90
90
* @public
91
91
* @type {string }
92
92
*/
93
- AWAY_FROM_ZERO : "away_from_zero " ,
93
+ AWAY_FROM_ZERO : "AWAY_FROM_ZERO " ,
94
94
/**
95
95
* Rounding mode to round towards the nearest neighbor unless both neighbors are equidistant, in which case round towards negative infinity.
96
96
* @public
97
97
* @type {string }
98
98
*/
99
- HALF_FLOOR : "half_floor " ,
99
+ HALF_FLOOR : "HALF_FLOOR " ,
100
100
/**
101
101
* Rounding mode to round towards the nearest neighbor unless both neighbors are equidistant, in which case round towards positive infinity.
102
102
* @public
103
103
* @type {string }
104
104
*/
105
- HALF_CEILING : "half_ceiling " ,
105
+ HALF_CEILING : "HALF_CEILING " ,
106
106
/**
107
107
* Rounding mode to round towards the nearest neighbor unless both neighbors are equidistant, in which case round towards zero.
108
108
* @public
109
109
* @type {string }
110
110
*/
111
- HALF_TOWARDS_ZERO : "half_towards_zero " ,
111
+ HALF_TOWARDS_ZERO : "HALF_TOWARDS_ZERO " ,
112
112
/**
113
113
* Rounding mode to round towards the nearest neighbor unless both neighbors are equidistant, in which case round away from zero.
114
114
* @public
115
115
* @type {string }
116
116
*/
117
- HALF_AWAY_FROM_ZERO : "half_away_from_zero "
117
+ HALF_AWAY_FROM_ZERO : "HALF_AWAY_FROM_ZERO "
118
118
} ;
119
119
120
120
var mRoundingFunction = { } ;
@@ -2082,6 +2082,14 @@ sap.ui.define([
2082
2082
// Support custom function for rounding the number
2083
2083
fValue = sRoundingMode ( fValue , iMaxFractionDigits ) ;
2084
2084
} else {
2085
+ // The NumberFormat.RoundingMode had all values in lower case before and later changed all values to upper case
2086
+ // to match the key according to the UI5 guideline for defining enum. Therefore it's needed to support both
2087
+ // lower and upper cases. Here checks whether the value has only lower case letters and converts it all to upper
2088
+ // case if so.
2089
+ if ( sRoundingMode . match ( / ^ [ a - z _ ] + $ / ) ) {
2090
+ sRoundingMode = sRoundingMode . toUpperCase ( ) ;
2091
+ }
2092
+
2085
2093
if ( ! iMaxFractionDigits ) {
2086
2094
return mRoundingFunction [ sRoundingMode ] ( fValue ) ;
2087
2095
}
0 commit comments