Duke's Big Numbers 1.0
C++ and Blueprint libraries for performing math, analysis, and formatting with really large numbers (>10e308).
Loading...
Searching...
No Matches
DecimalFullFormatter.h
1// Copyright (C)2023 Smiling Cat Entertainment, LTD. All Rights Reserved.
2
3#pragma once
4
5#include <optional>
6#include "CoreMinimal.h"
7#include "UObject/NoExportTypes.h"
8#include "Internationalization/FastDecimalFormat.h"
9#include "Internationalization/Culture.h"
10
11#include "Inline.h"
12#include "BigIntegerFormatter.h"
13#include "CultureAwareObject.h"
14
15#include "DecimalFullFormatter.generated.h"
16
20UCLASS(Blueprintable)
21class DUKESBIGNUMBERS_API UDecimalFullFormatter : public UBigIntegerFormatter, public Duke::MCultureAwareObject
22{
23 GENERATED_BODY()
24
25public:
31
39 static FString ToFullString(const FBigInteger& number);
40
46 static void AppendFullToString(const FBigInteger& number, FString& string);
47
53 static UDecimalFullFormatter* GetDefault();
54
59 virtual void OnAppendToString(const FBigInteger& number, FString& string) const override;
60
66 UFUNCTION(BlueprintPure, BlueprintInternalUseOnly, Category = "String|BigInteger")
67 bool GetUseGrouping() const;
68
74 UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly, Category = "String|BigInteger")
75 void SetUseGrouping(bool value);
76
82 UFUNCTION(BlueprintPure, BlueprintInternalUseOnly, Category = "String|BigInteger")
83 bool GetAlwaysSign() const;
84
90 UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly, Category = "String|BigInteger")
91 void SetAlwaysSign(bool value);
92
93private:
94 static UDecimalFullFormatter* defaultInstance;
95 static void NumberToString(const FBigInteger& number,
96 int digitsSoFar,
97 const FDecimalNumberFormattingRules& formattingRules,
98 const FNumberFormattingOptions& highPartOptions,
99 const FNumberFormattingOptions& lowerPartOptions,
100 FString& string);
101 static void CreateDefault();
102
106 UPROPERTY(BlueprintGetter = GetUseGrouping, BlueprintSetter = SetUseGrouping, Category = "String|BigInteger")
107 bool UseGrouping = true;
108
112 UPROPERTY(BlueprintGetter = GetAlwaysSign, BlueprintSetter = SetAlwaysSign, Category = "String|BigInteger")
113 bool AlwaysSign = false;
114
115 FDecimalNumberFormattingRules formattingRules;
116 FDecimalNumberFormattingRules internalFormattingRules;
117 FNumberFormattingOptions highPartOptions;
118 FNumberFormattingOptions lowerPartOptions;
119
120 void BuildOptions();
121};
122
123// If conditional inlining is ON, include inlinable functions here.
124#if DBN_INLINE_ENABLED
125#include "DecimalFullFormatter.inl"
126#endif
Definition: BigIntegerFormatter.h:19
Definition: DecimalFullFormatter.h:22
virtual void OnAppendToString(const FBigInteger &number, FString &string) const override
Definition: BigInteger.h:50