Cast a value to a BigDecimal