Skip to content

optionalCharacteristic being ignored in formatCurrency #473

@lyushenko

Description

@lyushenko

Issue

formatCurrency() does not respect optionalCharacteristic option and chops off leading zero before the decimal point.

See this line.

Input

numbro(-0.004).format({
  output: 'currency',
  currencySymbol: '$',
  currencyPosition: 'prefix',
  mantissa: 2,
  optionalCharacteristic: false
});

Expected output

-$0.00

Actual output

-$.00

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions