Skip to content

Commit

Permalink
Revert "removing comparison in currency standard type"
Browse files Browse the repository at this point in the history
This reverts commit de36381.
  • Loading branch information
Andrapyre committed May 5, 2024
1 parent 7f9e292 commit d331c6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions zio-schema/js/src/main/scala/zio/schema/StandardType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ object StandardType {
}

implicit object CurrencyType extends StandardType[java.util.Currency] {
override def tag: String = Tags.CURRENCY
override def defaultValue: Either[String, java.util.Currency] = Left("Currency generation not available in ScalaJS")
override def compare(x: java.util.Currency, y: java.util.Currency): Int = 0
override def tag: String = Tags.CURRENCY
override def defaultValue: Either[String, java.util.Currency] = Left("Currency generation not available in ScalaJS")
override def compare(x: java.util.Currency, y: java.util.Currency): Int =
x.getCurrencyCode().compareTo(y.getCurrencyCode())
}

implicit object BigDecimalType extends StandardType[java.math.BigDecimal] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ object StandardType {
override def defaultValue: Either[String, java.util.Currency] =
Left("Currency generation not available in Scala Native")

override def compare(x: java.util.Currency, y: java.util.Currency): Int = 0
override def compare(x: java.util.Currency, y: java.util.Currency): Int =
x.getCurrencyCode().compareTo(y.getCurrencyCode())
}

implicit object BigDecimalType extends StandardType[java.math.BigDecimal] {
Expand Down

0 comments on commit d331c6b

Please sign in to comment.