Skip to content

Instantly share code, notes, and snippets.

@sjl
Created September 16, 2013 16:07
Show Gist options
  • Save sjl/6582754 to your computer and use it in GitHub Desktop.
Save sjl/6582754 to your computer and use it in GitHub Desktop.
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