Created
September 16, 2013 16:07
-
-
Save sjl/6582754 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = BigDecimal(row.bigDecimal("mycol").get).toBigIntExact.get | |
row.bigDecimal("mycol") // returns Option[java.math.BigDecimal] | |
row.bigDecimal("mycol").get // pull the java.math.BigDecimal out (will scream if it's a None) | |
BigDecimal(row.bigDecimal("mycol").get) // convert to a scala.math.BigDecimal | |
BigDecimal(row.bigDecimal("mycol").get).toBigIntExact // convert to Option[scala.math.BigInt] | |
BigDecimal(row.bigDecimal("mycol").get).toBigIntExact.get // pull out the bigint or scream if it was a None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment