-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reducing complexity and preparing v1.0.7
- Loading branch information
1 parent
ceeb63e
commit e289076
Showing
12 changed files
with
676 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>JSDoc: Source: toCurrency/toCurrency.js</title> | ||
|
||
<script src="scripts/prettify/prettify.js"> </script> | ||
<script src="scripts/prettify/lang-css.js"> </script> | ||
<!--[if lt IE 9]> | ||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> | ||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="main"> | ||
|
||
<h1 class="page-title">Source: toCurrency/toCurrency.js</h1> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<section> | ||
<article> | ||
<pre class="prettyprint source linenums"><code>/** | ||
* Takes a number and returns it in the specified currency formatting.. | ||
* @param {String} str The text to be converted to kebab case. | ||
*/ | ||
|
||
export const toCurrency = (n, curr, LanguageFormat = undefined) => | ||
Intl.NumberFormat(LanguageFormat, { | ||
style: "currency", | ||
minimumFractionDigits: 2, | ||
currency: curr, | ||
}).format(n); | ||
|
||
// console.log(toCurrency(123456.789, 'EUR')); // ✔ should convert to €123,456.79 | currency: Euro | currencyLangFormat: Local | ||
// console.log(toCurrency(123456.789, 'RUB', 'Ru-ru')); // ✔ should convert to 123 456,79 ₽ | currency: Ruble | currencyLangFormat: Russian | ||
// console.log(toCurrency(123456.789, 'RUB')); // ✔ should convert to RUB 123,456.79 | currency: Ruble | currencyLangFormat: Local | ||
// console.log(toCurrency(123456.789, 'USD', 'en-us')); // ✔ should convert to $123,456.79 | currency: US Dollar | currencyLangFormat: English (United States) | ||
// console.log(toCurrency(123456.789, 'USD', 'fa')); // ✔ should convert to ۱۲۳٬۴۵۶٫۷۹ $ | currency: US Dollar | currencyLangFormat: Farsi | ||
// console.log(toCurrency(322342436423.2435, "JPY", "fi")); // ✔ should convert to 322 342 436 423 ¥ | currency: Japanese Yen | currencyLangFormat: Finnish | ||
// console.log(toCurrency(322342436423.2435, "JPY")); // ✔ should convert to ¥322,342,436,423 | currency: Japanese Yen | currencyLangFormat: Local | ||
</code></pre> | ||
</article> | ||
</section> | ||
|
||
|
||
|
||
|
||
</div> | ||
|
||
<nav> | ||
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul> | ||
</nav> | ||
|
||
<br class="clear"> | ||
|
||
<footer> | ||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time) | ||
</footer> | ||
|
||
<script> prettyPrint(); </script> | ||
<script src="scripts/linenumber.js"> </script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.