← Back to challenges

Convert Yen to USD

JavaScriptHardmathnumbers

Instructions

Create a function that can turn JPY (Japanese yen) to USD (American dollar).

Examples

yenToUsd(1) ➞ 0.01

yenToUsd(500) ➞ 4.65

yenToUsd(649) ➞ 6.04

Notes

  • Each JPY to USD conversion is JPY / 107.5
  • Round the result to two decimal places.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Learn Lodash: isEqual, Check if Two Items Are Equal