NumberFormatterSettings.RoundingMode(RoundingMode) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies how to determine the direction to round a number when it has more digits than fit in the desired precision.
[Android.Runtime.Register("roundingMode", "(Ljava/math/RoundingMode;)Landroid/icu/number/NumberFormatterSettings;", "GetRoundingMode_Ljava_math_RoundingMode_Handler", ApiSince=30)]
public virtual Java.Lang.Object? RoundingMode (Java.Math.RoundingMode? roundingMode);
[<Android.Runtime.Register("roundingMode", "(Ljava/math/RoundingMode;)Landroid/icu/number/NumberFormatterSettings;", "GetRoundingMode_Ljava_math_RoundingMode_Handler", ApiSince=30)>]
abstract member RoundingMode : Java.Math.RoundingMode -> Java.Lang.Object
override this.RoundingMode : Java.Math.RoundingMode -> Java.Lang.Object
Parameters
- roundingMode
- RoundingMode
The rounding mode to use.
Returns
The fluent chain.
- Attributes
Remarks
Specifies how to determine the direction to round a number when it has more digits than fit in the desired precision. When formatting 1.235:
<ul> <li>Ceiling rounding mode with integer precision: "2" <li>Half-down rounding mode with 2 fixed fraction digits: "1.23" <li>Half-up rounding mode with 2 fixed fraction digits: "1.24" </ul>
The default is HALF_EVEN. For more information on rounding mode, see the ICU userguide here:
https://unicode-org.github.io/icu/userguide/format_parse/numbers/rounding-modes
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.