Skip to content

Quantity.toString receiving a DecimalFormat #524

Description

@Lasering

Quantity could have the following methods:

import java.text.DecimalFormat

def toString(decimalFormat: DecimalFormat, uom: UnitOfMeasure[A]): String =
  s"${decimalFormat.format(to(uom))} ${uom.symbol}"
def toString(decimalFormat: DecimalFormat): String =
  toString(decimalFormat, unit)

DecimalFormat is locale aware so on JS this might not work out of the box.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions