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
ScientificGroupLabeler.h
1// Copyright (C)2023 Smiling Cat Entertainment, LTD. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Internationalization/FastDecimalFormat.h"
7#include "Internationalization/Culture.h"
8
9#include "Inline.h"
10#include "Format/GroupLabeler.h"
11#include "Format/CultureAwareObject.h"
12#include "ScientificGroupLabeler.generated.h"
13
17UCLASS(Blueprintable)
18class DUKESBIGNUMBERS_API UScientificGroupLabeler : public UGroupLabeler, public Duke::MCultureAwareObject
19{
20 GENERATED_BODY()
21
22public:
28
33 static FString GetScientificGroupLabel(int32 powerOfTen);
34
39 static int AppendScientificGroupLabel(int32 powerOfTen, FString& string);
40
46 UFUNCTION(BlueprintPure, BlueprintInternalUseOnly, Category = "String|BigInteger")
47 bool GetUseGrouping() const;
48
54 UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly, Category = "String|BigInteger")
55 void SetUseGrouping(bool value);
56
62 UFUNCTION(BlueprintPure, BlueprintInternalUseOnly, Category = "String|BigInteger")
63 bool GetAlwaysSign() const;
64
70 UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly, Category = "String|BigInteger")
71 void SetAlwaysSign(bool value);
72
78 static UScientificGroupLabeler* GetDefault();
79
84 int OnAppendGroupLabel(int32 powerOfTen, FString& string) const override;
85
86private:
87 static void CreateDefault();
88 void BuildOptions();
89
93 UPROPERTY(BlueprintGetter = GetUseGrouping, BlueprintSetter = SetUseGrouping, Category = "String|BigInteger")
94 bool UseGrouping = true;
95
99 UPROPERTY(BlueprintGetter = GetAlwaysSign, BlueprintSetter = SetAlwaysSign, Category = "String|BigInteger")
100 bool AlwaysSign = false;
101
102 static UScientificGroupLabeler* defaultInstance;
103
104 FDecimalNumberFormattingRules formattingRules;
105 FNumberFormattingOptions formattingOptions;
106
107};
108
109// If conditional inlining is ON, include inlinable functions here.
110#if DBN_INLINE_ENABLED
111#include "ScientificGroupLabeler.inl"
112#endif
Definition: GroupLabeler.h:19
Definition: ScientificGroupLabeler.h:19