Skip to content

Quantity.toString receiving a DecimalFormat #524

@Lasering

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions