RealDocs

UKismetTextLibrary::AsCurrencyBase

function Engine Blueprint Since unknown
#include "Kismet/KismetTextLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Formats an integer amount as currency in the current culture. BaseValue is specified in the smallest fractional unit of the currency (e.g. 650 for $6.50) and converted for display according to the active culture.

Caveats & Gotchas

  • CurrencyCode is completely independent of the display culture — they don't imply one another, so "EUR" formatted under an en-US culture renders as "€6.50", not "6,50€".
  • This is the current, non-deprecated replacement for AsCurrency_Integer and AsCurrency_Float, which are both marked deprecated in the engine source.
  • The smallest-fractional-unit convention isn't universal across all currencies (e.g. currencies with no minor unit), so verify BaseValue's meaning for the specific currency code in use.

Signature

static FText AsCurrencyBase(int32 BaseValue, const FString& CurrencyCode);

Parameters

Name Type Description Default
BaseValue int32 The amount expressed in the smallest fractional unit of the currency (e.g. cents).
CurrencyCode const FString& ISO 4217 currency code, e.g. "USD" or "EUR".

Return Type

FText

Example

Format a price stored in cents C++
int32 PriceInCents = 650;
FText PriceText = UKismetTextLibrary::AsCurrencyBase(PriceInCents, TEXT("EUR")); // "€6.50" in en-US

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.