Skip to content

currency resolves to a object value but not string by default #219

Open
@Shsgear

Description

@Shsgear

Hi there! I'm new here and has some trouble with the api.

Expect

By default, currency resolves to a string value.

2.51 + .01;                           // => 2.5199999999999996
currency(2.51).add(.01);      // => 2.52

Actual

It returns an object but not the string i expected

2.5199999999999996
{ intValue: 252,
  value: 2.52,
  s:
   { symbol: '$',
     separator: ',',
     decimal: '.',
     formatWithSymbol: false,
     errorOnInvalid: false,
     precision: 2,
     pattern: '!#',
     negativePattern: '-!#',
     increment: 0.01,
     groups: /(\d)(?=(\d{3})+\b)/g },
  p: 100 }

It works fine when i call format function.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions