From 0e7c6a790393c4e8af487ee462c482d3bf821c19 Mon Sep 17 00:00:00 2001 From: Mahdi Yari <m.yary16@gmail.com> Date: Tue, 3 Nov 2020 19:47:06 +0330 Subject: [PATCH] formatter.numberWithCommas --- doc/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/README.md b/doc/README.md index 20d9e08..2186a43 100644 --- a/doc/README.md +++ b/doc/README.md @@ -2261,6 +2261,31 @@ Return Example: "53.442 HIVE" ``` +### Number With Commas +Formats a big number, by adding a comma on every 3 digits. +Attention - only works on strings. No numbers can be passed directly. + +```js +hive.formatter.numberWithCommas(x); +``` + +|Parameter|Datatype|Description| +|---------|--------|-----------| +|x|string|Number to format as string| + + +Call Example: +```js +hive.formatter.numberWithCommas(53304432342.432.toString()); +// or +hive.formatter.numberWithCommas("53304432342.432"); +``` + +Return Example: +```js + "53,304,432,342.432" +``` + ### Create Suggested Password ``` var password = hive.formatter.createSuggestedPassword(); -- GitLab