diff --git a/zio-schema/js/src/main/scala/zio/schema/StandardType.scala b/zio-schema/js/src/main/scala/zio/schema/StandardType.scala index f5cce667f..4f6f60940 100644 --- a/zio-schema/js/src/main/scala/zio/schema/StandardType.scala +++ b/zio-schema/js/src/main/scala/zio/schema/StandardType.scala @@ -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] { diff --git a/zio-schema/native/src/main/scala/zio/schema/StandardType.scala b/zio-schema/native/src/main/scala/zio/schema/StandardType.scala index 8fd86f7e5..8d375b862 100644 --- a/zio-schema/native/src/main/scala/zio/schema/StandardType.scala +++ b/zio-schema/native/src/main/scala/zio/schema/StandardType.scala @@ -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] {