@sebgroup/frontend-tools
Advanced tools
Comparing version 1.1.0 to 1.1.1
export interface ToCurrencyOptions { | ||
separator?: string; | ||
radix?: string; | ||
noCents?: boolean; | ||
decimals?: number; | ||
currency?: string; | ||
showDecimals?: boolean; | ||
numOfDecimals?: number; | ||
} | ||
@@ -11,5 +10,5 @@ /** | ||
* @param {number} value raw number value | ||
* @param {ToCurrencyOptions} options You can control the sperator, radix, currency string and showing cents using these options | ||
* @param {ToCurrencyOptions} options You can control the sperator, radix, decimals visibility and number of decimal places using these options | ||
* @returns {string} The formatted currency string | ||
*/ | ||
export declare function toCurrency(value: number | string, options?: ToCurrencyOptions): string; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("@sebgroup/frontend-tools",[],t):"object"==typeof exports?exports["@sebgroup/frontend-tools"]=t():e["@sebgroup/frontend-tools"]=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=44)}({44:function(e,t,r){"use strict";function n(e,t){void 0===t&&(t={});var r=function(e){var r,n;e-Math.floor(e)==0?r=e:(r=Math.floor(e),n=t&&t.noCents?null:Number((e-Math.floor(e)).toFixed(t&&t.decimals?t.decimals:2).replace("0.","")));var o=String(r).split(""),u=[];return o.map((function(e,r){(o.length-(r+1)||1)%3==0?(u.push(e),u.push(t&&t.separator?t.separator:",")):u.push(e)})),u.join("")+(n?""+(t&&t.radix?t.radix:".")+n:"")+(t&&t.currency?" "+t.currency:"")};return"number"==typeof e?r(e):"string"!=typeof e||isNaN(Number(e))?"":r(Number(e))}r.r(t),r.d(t,"toCurrency",(function(){return n}))}})})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("@sebgroup/frontend-tools",[],t):"object"==typeof exports?exports["@sebgroup/frontend-tools"]=t():e["@sebgroup/frontend-tools"]=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=44)}({44:function(e,t,r){"use strict";function n(e,t){void 0===t&&(t={});var r=function(e){var r,n;e-Math.floor(e)==0?r=e:(r=Math.floor(e),n=t&&t.showDecimals?null:Number((e-Math.floor(e)).toFixed(t&&t.numOfDecimals?t.numOfDecimals:2).replace("0.","")));var o=String(r).split(""),u=[];return o.map((function(e,r){(o.length-(r+1)||1)%3==0?(u.push(e),u.push(t&&t.separator?t.separator:",")):u.push(e)})),u.join("")+(n?""+(t&&t.radix?t.radix:".")+n:"")};return"number"==typeof e?r(e):"string"!=typeof e||isNaN(Number(e))?"":r(Number(e))}r.r(t),r.d(t,"toCurrency",(function(){return n}))}})})); |
{ | ||
"name": "@sebgroup/frontend-tools", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A set of frontend tools", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103691
542