aboutsummaryrefslogtreecommitdiff
path: root/lib/commerce.js
diff options
context:
space:
mode:
authorJakub Mandula <[email protected]>2017-02-26 13:51:40 +0000
committerJakub Mandula <[email protected]>2017-02-26 13:51:40 +0000
commit232a2a58d70935c57d311b5ba237347f703c2131 (patch)
tree69f695e62e17386988c47f8522bf5e14db193839 /lib/commerce.js
parentd6c20353360ef1eefb56128eeb50ece4f5845372 (diff)
parentf379057be0112d6732b056d93d1380be18e1087a (diff)
downloadfaker-232a2a58d70935c57d311b5ba237347f703c2131.tar.xz
faker-232a2a58d70935c57d311b5ba237347f703c2131.zip
Merge branch 'Mark/origin' into creditCard
Diffstat (limited to 'lib/commerce.js')
-rw-r--r--lib/commerce.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/commerce.js b/lib/commerce.js
index 306cf337..56e63dba 100644
--- a/lib/commerce.js
+++ b/lib/commerce.js
@@ -42,14 +42,16 @@ var Commerce = function (faker) {
* @param {number} max
* @param {number} dec
* @param {string} symbol
+ *
+ * @return {string}
*/
self.price = function(min, max, dec, symbol) {
min = min || 0;
max = max || 1000;
- dec = dec || 2;
+ dec = dec === undefined ? 2 : dec;
symbol = symbol || '';
- if(min < 0 || max < 0) {
+ if (min < 0 || max < 0) {
return symbol + 0.00;
}
@@ -109,7 +111,7 @@ var Commerce = function (faker) {
*/
self.product = function() {
return faker.random.arrayElement(faker.definitions.commerce.product_name.product);
- }
+ };
return self;
};