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
UScientificGroupLabeler Class Reference

#include "ScientificGroupLabeler.h"

Public Member Functions

 UScientificGroupLabeler ()
 
bool GetUseGrouping () const
 
void SetUseGrouping (bool value)
 
bool GetAlwaysSign () const
 
void SetAlwaysSign (bool value)
 
int OnAppendGroupLabel (int32 powerOfTen, FString &string) const override
 
- Public Member Functions inherited from UGroupLabeler
FString GetGroupLabel (int32 powerOfTen) const
 
FString & AppendGroupLabel (int32 PowerOfTen, UPARAM(ref) FString &AppendTo, int32 &Remainder) const
 
virtual int32 OnAppendGroupLabel (int32 powerOfTen, FString &string) const
 
FString GetSeparatorBefore () const
 
void SetSeparatorBefore (const FString &value)
 

Static Public Member Functions

static FString GetScientificGroupLabel (int32 powerOfTen)
 
static int AppendScientificGroupLabel (int32 powerOfTen, FString &string)
 
static UScientificGroupLabelerGetDefault ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from Duke::MCultureAwareObject
static const FCulture & GetCulture ()
 
static void AppendPrefix (bool isNegative, const FDecimalNumberFormattingRules &rules, bool alwaysSign, FString &string)
 
static void AppendSuffix (bool isNegative, const FDecimalNumberFormattingRules &rules, bool alwaysSign, FString &string)
 
static int32 EstimateNumberLength (int32 numDecimalDigits, bool isNegative, bool alwaysSign, const FDecimalNumberFormattingRules &rules, const FNumberFormattingOptions &options)
 
static int32 EstimatePrefix (bool isNegative, const FDecimalNumberFormattingRules &rules, bool alwaysSign)
 
static int32 EstimateSuffix (bool isNegative, const FDecimalNumberFormattingRules &rules, bool alwaysSign)
 
static void ReserveSpaceForNumber (int32 numDecimalDigits, bool isNegative, bool alwaysSign, const FDecimalNumberFormattingRules &rules, const FNumberFormattingOptions &options, FString &string)
 
static void AppendAffix (bool isNegative, const FDecimalNumberFormattingRules &rules, bool alwaysSign, const FString &negative, const FString &positive, FString &string)
 
static int32 EstimateAffix (bool isNegative, const FDecimalNumberFormattingRules &rules, bool alwaysSign, const FString &negative, const FString &positive)
 
- Protected Attributes inherited from UGroupLabeler
FString SeparatorBefore
 

Detailed Description

Formats powers of ten using Scientific Notation (aka "e" notation, i.e. the "e309" in 10e309)

Constructor & Destructor Documentation

◆ UScientificGroupLabeler()

UScientificGroupLabeler::UScientificGroupLabeler ( )
Flavor:Constructor

Creates a new Scientific Notation Group Labeler

Implements Opcode:
Flavor:Constructor SG ← sg 0

Member Function Documentation

◆ AppendScientificGroupLabel()

DBN_FORCEINLINE int UScientificGroupLabeler::AppendScientificGroupLabel ( int32  powerOfTen,
FString &  string 
)
staticFlavor:Static

Provides implementation for appending the group label for the specified powerOfTen into string, and returning any remaining power of ten.

Parameters
powerOfTenThe power of ten for which to get the label
stringThe string to append the group label to
Returns
Any remaining power of ten beyond the closest label (see below)
Note
Remainder is any remaining power of ten beyond the closest label. For example, if you pass in 4 to the SI Unit Names labeler, you will get back "kilo", plus a remainder of one, representing that this is tens of kilos.
Override this function to create your own custom Group Labeler that can be plugged into a Scaling Formatter.
Implements Opcode:
Flavor:Instance I4 ← lbl BG I4 S&
Implements Opcode:
Flavor:Static I4 ← lbls I4 S&

◆ GetAlwaysSign()

DBN_FORCEINLINE bool UScientificGroupLabeler::GetAlwaysSign ( ) const
Flavor:Instance

Gets whether formatted exponents are always signed

Returns
true if formatted exponents are always signed, otherwise false
Implements Opcode:
Flavor:Instance B ← gosgn SG

◆ GetDefault()

DBN_FORCEINLINE UScientificGroupLabeler * UScientificGroupLabeler::GetDefault ( )
staticFlavor:Static

Gets the default instance of this type of group labeler

Returns
the default instance of this type of group labeler
Implements Opcode:
Flavor:Static SG ← glbls 0

◆ GetScientificGroupLabel()

DBN_FORCEINLINE FString UScientificGroupLabeler::GetScientificGroupLabel ( int32  powerOfTen)
staticFlavor:Static

Gets the group label for the specified powerOfTen

Parameters
powerOfTenThe power of ten for which to get the label
Returns
The group label for the specified power of ten
Note
Any remainder in the powerOfTen is lost. For example, if you pass in 4 to the SI Unit Names labeler, you will get back "kilo", but will lose the information that this actually represented tens of kilos instead of ones of kilos. To keep this information, use AppendGroupLabel.
Implements Opcode:
Flavor:Instance S ← lbl BG I4
Implements Opcode:
Flavor:Static S ← lbls I4

◆ GetUseGrouping()

DBN_FORCEINLINE bool UScientificGroupLabeler::GetUseGrouping ( ) const
Flavor:Instance

Gets whether digit grouping is applied to formatting for the exponent

Returns
true if digit grouping is applied to formatting for the exponent, otherwise false
Implements Opcode:
Flavor:Instance B ← gogrp SG

◆ OnAppendGroupLabel()

int UScientificGroupLabeler::OnAppendGroupLabel ( int32  powerOfTen,
FString &  string 
) const
overridevirtualFlavor:Instance

Provides implementation for appending the group label for the specified powerOfTen into string, and returning any remaining power of ten.

Parameters
powerOfTenThe power of ten for which to get the label
stringThe string to append the group label to
Returns
Any remaining power of ten beyond the closest label (see below)
Note
Remainder is any remaining power of ten beyond the closest label. For example, if you pass in 4 to the SI Unit Names labeler, you will get back "kilo", plus a remainder of one, representing that this is tens of kilos.
Override this function to create your own custom Group Labeler that can be plugged into a Scaling Formatter.
Implements Opcode:
Flavor:Instance I4 ← lbl BG I4 S&
Implements Opcode:
Flavor:Instance I4 ← lbl SG I4 S&

Reimplemented from UGroupLabeler.

◆ SetAlwaysSign()

DBN_FORCEINLINE void UScientificGroupLabeler::SetAlwaysSign ( bool  value)
Flavor:Instance

Sets whether formatted exponents are always signed

Parameters
valuetrue if formatted exponents are always signed, otherwise false
Implements Opcode:
Flavor:Instance 0 ← sosgn SG B

◆ SetUseGrouping()

DBN_FORCEINLINE void UScientificGroupLabeler::SetUseGrouping ( bool  value)
Flavor:Instance

Sets whether digit grouping is applied to formatting for the exponent

Parameters
valuetrue if digit grouping is applied to formatting for the exponent, otherwise false
Implements Opcode:
Flavor:Instance 0 ← sogrp SG B

The documentation for this class was generated from the following files: