Repository navigation
Format Currency
Formats a value as a string with the currency symbol for a specified country.
Format-Currency [-Value] <Decimal> [-Currency] <String> [[-Decimals] <Int32>] [[-ConvertTo] <String>]
[-SymbolAtEnd] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Outputs a value with the specified currency symbol. Can also be used to perform a currency conversion and then format as the converted currency.
100 | Format-Currency -Currency USD
Formats the value (provided via the pipeline) as USD: $100.00.
Convert-Currency -Value 100 -From USD -To EUR | Format-Currency
Converts 100 USD to EUR and formats the result as EUR, with the Currency parameter inferred from the pipeline, e.g.: €92.15
100 | Format-Currency -Currency USD -ConvertTo GBP
Converts 100 from USD to GBP and formats as GBP, e.g.: £79.67
Format-Currency -Value 100 -Currency USD
Formats the value as USD: $100.00.
Format-Currency -Value 100.2345 -Currency USD -Decimals 3
Formats the value as USD: $100.235.
Format-Currency -Value 100 -Currency USD -SymbolAtEnd
Formats the value as USD: 100.00$.
The currency value.
Type: Decimal
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: 0
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThe currency represented by value. If not specified, this can be picked up from the pipeline by property name, e.g. from the output of Convert-Currency or Convert-CryptoCurrency.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe number of decimal places to round the value to. Default: 2
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 2
Accept pipeline input: False
Accept wildcard characters: FalsePerform a currency conversion and then format as that currency.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalsePlace the currency symbol after the value.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{Fill ProgressAction Description}}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
A numerical value, can be provided via the pipeline. If piped from Convert-Currency or Convert-CryptoCurrency, the Currency parameter is automatically populated from the destination currency of that conversion.
https://github.com/markwragg/PowerShell-CurrencyConverter/wiki/Format-Currency