aws-cdk-lib.SizeRoundingBehavior

enum SizeRoundingBehavior

LanguageType name
.NETAmazon.CDK.SizeRoundingBehavior
Gogithub.com/aws/aws-cdk-go/awscdk/v2#SizeRoundingBehavior
Javasoftware.amazon.awscdk.SizeRoundingBehavior
Pythonaws_cdk.SizeRoundingBehavior
TypeScript (source)aws-cdk-lib » SizeRoundingBehavior

Rounding behaviour when converting between units of Size.

Example

Size.mebibytes(2).toKibibytes()                                             // yields 2048
Size.kibibytes(2050).toMebibytes({ rounding: SizeRoundingBehavior.FLOOR })  // yields 2

Members

NameDescription
FAILFail the conversion if the result is not an integer.
FLOORIf the result is not an integer, round it to the closest integer less than the result.
NONEDon't round.

FAIL

Fail the conversion if the result is not an integer.


FLOOR

If the result is not an integer, round it to the closest integer less than the result.


NONE

Don't round.

Return even if the result is a fraction.