Integrate STNumber with STParsedJSON

This commit is contained in:
John Freeman
2024-11-07 10:49:57 -06:00
committed by Bronek Kozicki
parent 49e0d54c76
commit 1a032f04e3
7 changed files with 156 additions and 75 deletions

View File

@@ -417,7 +417,7 @@ STAmount
amountFromQuality(std::uint64_t rate);
STAmount
amountFromString(Asset const& issue, std::string const& amount);
amountFromString(Asset const& asset, std::string const& amount);
STAmount
amountFromJson(SField const& name, Json::Value const& v);

View File

@@ -83,6 +83,19 @@ private:
std::ostream&
operator<<(std::ostream& out, STNumber const& rhs);
struct NumberParts
{
std::uint64_t mantissa = 0;
int exponent = 0;
bool negative = false;
};
NumberParts
partsFromString(std::string const& number);
STNumber
numberFromJson(SField const& field, Json::Value const& value);
} // namespace ripple
#endif