Rounds off a number to the requested number of digits.
Limit-Digits.ps1 [[-Digits] <Int32>] [-InputObject] <Object> [-Mode <MidpointRounding>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
[math]::PI |Limit-Digits.ps1 4
3.1416
1.5 |Limit-Digits.ps1 -Mode ToZero
1
The number of digits following the decimal to truncate the value to.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
A numeric value to round off.
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The rounding methodology to use.
Type: MidpointRounding
Parameter Sets: (All)
Aliases:
Accepted values: ToEven, AwayFromZero, ToZero, ToNegativeInfinity, ToPositiveInfinity
Required: False
Position: Named
Default value: ToEven
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.