FormIt C++ API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
FormIt::StringConversion API

Description

Functions

FORMIT_CORE_EXPORT ::string FormIt::StringConversion::LinearValueToString (double val, bool forceImperialFeetInchesOrMeter=false, bool bMaintainUnitType=false, const bool includeUnitsAndThousandsSeparators=true, const unsigned int decimalPlaces=2)
 Convert a linear value to a string.
 
FORMIT_CORE_EXPORT ::pair< bool, double > FormIt::StringConversion::StringToLinearValue (1::string const &str, bool forceImperialFeetInchesOrMeter=false, bool bMaintainUnitType=false)
 Convert a string to a linear value.
 
FORMIT_CORE_EXPORT ::string FormIt::StringConversion::AreaValueToString (double val, bool includeUnitsAndThousandsSeparators=false, unsigned int decimalPlaces=2, bool forceFeetOrMeter=false)
 Convert an area value to a string.
 
FORMIT_CORE_EXPORT ::pair< bool, double > FormIt::StringConversion::StringToAreaValue (1::string const &str, bool forceFeetOrMeter=false, bool bMaintainUnitType=false)
 Convert a string to an area value.
 
FORMIT_CORE_EXPORT ::string FormIt::StringConversion::VolumeValueToString (double val, bool includeUnitsAndThousandsSeparators=false, unsigned int decimalPlaces=2, bool forceFeetOrMeter=false)
 Convert a volume value to a string.
 
FORMIT_CORE_EXPORT ::pair< bool, double > FormIt::StringConversion::StringToVolumeValue (1::string const &str, bool forceFeetOrMeter=false, bool bMaintainUnitType=false)
 Convert a string to a volume value.
 

Function Documentation

◆ AreaValueToString()

FORMIT_CORE_EXPORT ::string FormIt::StringConversion::AreaValueToString ( double  val,
bool  includeUnitsAndThousandsSeparators = false,
unsigned int  decimalPlaces = 2,
bool  forceFeetOrMeter = false 
)

Convert an area value to a string.

If forceFeetOrMeter is true, the string will always be formatted as square feet or meter

Parameters
[in]val
[in]includeUnitsAndThousandsSeparators
[in]decimalPlaces
[in]forceFeetOrMeter

◆ LinearValueToString()

FORMIT_CORE_EXPORT ::string FormIt::StringConversion::LinearValueToString ( double  val,
bool  forceImperialFeetInchesOrMeter = false,
bool  bMaintainUnitType = false,
const bool  includeUnitsAndThousandsSeparators = true,
const unsigned int  decimalPlaces = 2 
)

Convert a linear value to a string.

If forceFeetOrMeter is true, the string will always be formatted as feet or meter If bMaintainUnitType is true, the value will be in the units of the model. If includeUnitsAndThousandsSeparators is true, units will be included decimalPlaces, the number of decimal places to display If forceImperialFeetInchesOrMeter is true, the value will always be interpreted as feet or meter If bMaintainUnitType is true, the value will be in the units of the model. NOTE: FormIt will set the current units based off the loaded model using FormIt::Model::SetUnitTypeCurrent

Parameters
[in]val
[in]forceImperialFeetInchesOrMeter
[in]bMaintainUnitType
[in]includeUnitsAndThousandsSeparators
[in]decimalPlaces

◆ StringToAreaValue()

FORMIT_CORE_EXPORT ::pair< bool, double > FormIt::StringConversion::StringToAreaValue ( 1::string const &  str,
bool  forceFeetOrMeter = false,
bool  bMaintainUnitType = false 
)

Convert a string to an area value.

If forceFeetOrMeter is true, the value will always be interpreted as feet or meter, unless it contains an explicit unit. For example "2" will be 2 square feet, whereas "2 sq in" will remain 2 square inches If bMaintainUnitType is true, the value will be in the units of the model. Returns true in the pair first, if succesful, and the converted value in the pair second

Parameters
[in]str
[in]forceFeetOrMeter
[in]bMaintainUnitType

◆ StringToLinearValue()

FORMIT_CORE_EXPORT ::pair< bool, double > FormIt::StringConversion::StringToLinearValue ( 1::string const &  str,
bool  forceImperialFeetInchesOrMeter = false,
bool  bMaintainUnitType = false 
)

Convert a string to a linear value.

If forceImperialFeetInchesOrMeter is true, the value will always be interpreted as feet or meter, unless it contains an explicit unit. If bMaintainUnitType is true, the value will be in the units of the model. For example "2" will be 2 feet, whereas "2 in" will remain 2 inches Returns true in the pair first, if successful, and the converted value in the pair second NOTE: FormIt will set the current units based off the loaded model using FormIt::Model::SetUnitTypeCurrent

Parameters
[in]str
[in]forceImperialFeetInchesOrMeter
[in]bMaintainUnitType

◆ StringToVolumeValue()

FORMIT_CORE_EXPORT ::pair< bool, double > FormIt::StringConversion::StringToVolumeValue ( 1::string const &  str,
bool  forceFeetOrMeter = false,
bool  bMaintainUnitType = false 
)

Convert a string to a volume value.

If forceFeetOrMeter is true, the value will always be interpreted as cubic feet or meter, unless it contains an explicit unit. For example "2" will be 2 cubic feet, whereas "2 cu in" will remain 2 cubic inches Returns true in the pair first, if succesful, and the converted value in the pair second

Parameters
[in]str
[in]forceFeetOrMeter
[in]bMaintainUnitType

◆ VolumeValueToString()

FORMIT_CORE_EXPORT ::string FormIt::StringConversion::VolumeValueToString ( double  val,
bool  includeUnitsAndThousandsSeparators = false,
unsigned int  decimalPlaces = 2,
bool  forceFeetOrMeter = false 
)

Convert a volume value to a string.

If forceFeetOrMeter is true, the string will always be formatted as square feet or meter

Parameters
[in]val
[in]includeUnitsAndThousandsSeparators
[in]decimalPlaces
[in]forceFeetOrMeter