UKismetTextLibrary::Conv_DoubleToText
#include "Kismet/KismetTextLibrary.h"
Access: public
Specifiers: staticBlueprintPureBlueprintAutocast
Description
Converts a double to formatted, localized text using the given number and rounding options. Backs the 'To Text (Float)' Blueprint autocast node.
Caveats & Gotchas
- • Unlike the integer conversions, RoundingMode has no default value in C++ and must always be supplied explicitly when calling from native code.
- • MaximumFractionalDigits defaults to 3, so values with more precision are silently rounded — raise it explicitly if you need finer display precision.
- • The BlueprintAutocast version used for float-to-text pins in Blueprint applies RoundingMode::HalfToEven by default via the node's pin default, which differs from naive rounding for .5 cases.
Signature
static FText Conv_DoubleToText(double Value, TEnumAsByte<ERoundingMode> RoundingMode, bool bAlwaysSign = false, bool bUseGrouping = true, int32 MinimumIntegralDigits = 1, int32 MaximumIntegralDigits = 324, int32 MinimumFractionalDigits = 0, int32 MaximumFractionalDigits = 3); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Value | double | The floating-point value to convert. | — |
| RoundingMode | TEnumAsByte<ERoundingMode> | How fractional digits beyond the maximum should be rounded. | — |
| bAlwaysSign | bool | Whether to always show a sign (+/-), even for positive values. | false |
| bUseGrouping | bool | Whether to insert culture-appropriate thousands separators. | true |
| MinimumIntegralDigits | int32 | Minimum number of integer digits to display, zero-padding if needed. | 1 |
| MaximumIntegralDigits | int32 | Maximum number of integer digits to display. | 324 |
| MinimumFractionalDigits | int32 | Minimum number of fractional digits to display, zero-padding if needed. | 0 |
| MaximumFractionalDigits | int32 | Maximum number of fractional digits to display before rounding. | 3 |
Return Type
FText Example
Format a float value with two decimal places C++
double Distance = 42.567;
FText DistanceText = UKismetTextLibrary::Conv_DoubleToText(Distance, ERoundingMode::HalfToEven, false, true, 1, 324, 0, 2); // "42.57" Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?