hakanensari / frankfurter

šŸ’± Open-source API that wraps currency data provided by the ECB

Home Page:https://www.frankfurter.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Float rates become exponential notation

baddwin opened this issue Ā· comments

commented

Using lower rate base currencies like IDR produces scientific notation, and less precise.

{
  "amount": 1.0,
  "base": "IDR",
  "date": "2020-04-30",
  "rates": {
    "USD": 7.0e-05
  }
}

Good catch, noted. Google returns 0.000066 USD for 1 IDR; Frankfurter should format likewise.

@baddwin, returned values should now be more preciseā€”for instance, 0.000067 instead of 0.00007.

The scientific notation issue must be a client-side; the API is returning decimals.

commented

@hakanensari awesome, thank you.
Yeah, I think so. I use Insomnia REST client for querying the API, fyi.
But no worries, I can pull the decimal values in the backend.