-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toBigDecimal and toBigDecimalOption #121
Comments
What is the correct way of doing this? Should I add a: import scala.util.control.Exception.*
implicit final class StringOpsExtensions (private val string: String) extends AnyVal {
def toBigDecimal: BigDecimal = BigDecimal(string)
def toBigDecimalOption: Option[BigDecimal] = catching(classOf[NumberFormatException]).opt(toBigDecimal)
} |
would the desirability of having this be affected by https://docs.scala-lang.org/scala3/reference/experimental/numeric-literals.html ? |
@SethTisue an important difference is that Scala 3 feature is for literals only. |
@SethTisue the I only added the Ideally these methods would be added to the |
I can make a PR if this is something that would be accepted.
The text was updated successfully, but these errors were encountered: