Skip to content

Instantly share code, notes, and snippets.

@phearnot
Created September 21, 2012 16:41
Show Gist options
  • Save phearnot/3762546 to your computer and use it in GitHub Desktop.
Save phearnot/3762546 to your computer and use it in GitHub Desktop.
implicit val bdStringView = StringView.of[BigDecimal] as { _.toString }
def makeStringValue[T](implicit sv: StringView) = new StringValue {
def getString(value: AnyRef) = sv(value.asInstanceOf[T])
}
bdStringValue = makeStringValue[BigDecimal]
strStringValue = makeStringValue[String]
qtyStringValue = makeStringValue[Long](StringView.of[Long] as { _.toString }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment