Skip to content

Conversation

@JakeLardinois
Copy link

Additional info:

  • NumberStyles.Float is a predefined combination of flags that already covers all the scenarios ie NumberStyles.Float ==
    NumberStyles.AllowLeadingWhite |
    NumberStyles.AllowTrailingWhite |
    NumberStyles.AllowLeadingSign |
    NumberStyles.AllowDecimalPoint |
    NumberStyles.AllowExponent. Bitwise & between flags like AllowLeadingSign & AllowDecimalPoint results in 0 — they’re different bit positions, so you’re OR-ing together mostly ineffective combinations. In short: most of the manually combined styles collapse to AllowLeadingSign | AllowDecimalPoint | AllowExponent, which is exactly what Float already provides — but with more completeness (whitespace handling).

  • Removed duplicate "decimal.Parse(xrpToConvert..."

  • Removed if (!(xrpToConvert is string)...) because its always false

  • Used xrpValue directly in math

  • Added CultureInfo.InvariantCulture to final ToString() to prevent unexpected formatting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant