Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CellSize values should not be truncated to integer when parsing from Json. #2174

Merged
merged 2 commits into from
May 2, 2017

Conversation

mteldridge
Copy link
Contributor

No description provided.

@@ -46,7 +46,7 @@ trait Implicits extends HistogramJsonFormats {
)
def read(value: JsValue): CellSize =
value.asJsObject.getFields("width", "height") match {
case Seq(JsNumber(width), JsNumber(height)) => CellSize(width.toInt, height.toInt)
case Seq(JsNumber(width), JsNumber(height)) => CellSize(width.toDouble, height.toDouble)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reminder to anyone checking this out that JsNumber contains a BigDecimal, so the explicit cast to Double is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants