Comparing version 0.17.90 to 0.17.93
@@ -33,3 +33,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
}; | ||
export var currencyCalc = function currencyCalc(props, after, before, afterSingular) { | ||
export var currencyCalc = function currencyCalc(props, after, before, afterSingular, isAbsolute) { | ||
var children = props.children, | ||
@@ -56,4 +56,4 @@ input = props.input, | ||
//maximumSignificantDigits: maximumSignificantDigits, | ||
minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits ? minimumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2, | ||
maximumFractionDigits: value <= 0.005 ? 4 : value <= 0.05 ? 3 : value <= 0.5 ? 2 : maximumFractionDigits === 0 ? 0 : maximumFractionDigits ? maximumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2 | ||
minimumFractionDigits: isAbsolute === true ? minimumFractionDigits === 0 : maximumFractionDigits === 0 ? 0 : minimumFractionDigits ? minimumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2, | ||
maximumFractionDigits: isAbsolute === true ? maximumFractionDigits === 0 : value <= 0.005 ? 4 : value <= 0.05 ? 3 : value <= 0.5 ? 2 : maximumFractionDigits === 0 ? 0 : maximumFractionDigits ? maximumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2 | ||
}; // Convert to Locale String | ||
@@ -60,0 +60,0 @@ |
@@ -12,7 +12,7 @@ import React from 'react'; | ||
export var People = function People(props) { | ||
return currencyCalc(props, 'Partners', undefined, true); | ||
return currencyCalc(props, 'People', undefined, true, true); | ||
}; // Generate Partners | ||
export var Partners = function Partners(props) { | ||
return currencyCalc(props, 'Partners', undefined, true); | ||
return currencyCalc(props, 'Partners', undefined, true, true); | ||
}; // Generate MT | ||
@@ -33,11 +33,11 @@ | ||
export var Beneficiaries = function Beneficiaries(props) { | ||
return currencyCalc(props, 'Beneficaries', undefined, true); | ||
return currencyCalc(props, 'Beneficaries', undefined, true, true); | ||
}; // Generate Households | ||
export var Households = function Households(props) { | ||
return currencyCalc(props, 'Households', undefined, true); | ||
return currencyCalc(props, 'Households', undefined, true, true); | ||
}; // Generate Trips | ||
export var Trips = function Trips(props) { | ||
return currencyCalc(props, 'Trips', undefined, true); | ||
return currencyCalc(props, 'Trips', undefined, true, true); | ||
}; // Generate Households | ||
@@ -44,0 +44,0 @@ |
@@ -50,3 +50,3 @@ "use strict"; | ||
var currencyCalc = function currencyCalc(props, after, before, afterSingular) { | ||
var currencyCalc = function currencyCalc(props, after, before, afterSingular, isAbsolute) { | ||
var children = props.children, | ||
@@ -73,4 +73,4 @@ input = props.input, | ||
//maximumSignificantDigits: maximumSignificantDigits, | ||
minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits ? minimumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2, | ||
maximumFractionDigits: value <= 0.005 ? 4 : value <= 0.05 ? 3 : value <= 0.5 ? 2 : maximumFractionDigits === 0 ? 0 : maximumFractionDigits ? maximumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2 | ||
minimumFractionDigits: isAbsolute === true ? minimumFractionDigits === 0 : maximumFractionDigits === 0 ? 0 : minimumFractionDigits ? minimumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2, | ||
maximumFractionDigits: isAbsolute === true ? maximumFractionDigits === 0 : value <= 0.005 ? 4 : value <= 0.05 ? 3 : value <= 0.5 ? 2 : maximumFractionDigits === 0 ? 0 : maximumFractionDigits ? maximumFractionDigits : outputCalc && outputCalc.defaultmaximumFractionDigits ? outputCalc.defaultmaximumFractionDigits : 2 | ||
}; // Convert to Locale String | ||
@@ -77,0 +77,0 @@ |
@@ -28,3 +28,3 @@ "use strict"; | ||
var People = function People(props) { | ||
return (0, _Unit.currencyCalc)(props, 'Partners', undefined, true); | ||
return (0, _Unit.currencyCalc)(props, 'People', undefined, true, true); | ||
}; // Generate Partners | ||
@@ -36,3 +36,3 @@ | ||
var Partners = function Partners(props) { | ||
return (0, _Unit.currencyCalc)(props, 'Partners', undefined, true); | ||
return (0, _Unit.currencyCalc)(props, 'Partners', undefined, true, true); | ||
}; // Generate MT | ||
@@ -65,3 +65,3 @@ | ||
var Beneficiaries = function Beneficiaries(props) { | ||
return (0, _Unit.currencyCalc)(props, 'Beneficaries', undefined, true); | ||
return (0, _Unit.currencyCalc)(props, 'Beneficaries', undefined, true, true); | ||
}; // Generate Households | ||
@@ -73,3 +73,3 @@ | ||
var Households = function Households(props) { | ||
return (0, _Unit.currencyCalc)(props, 'Households', undefined, true); | ||
return (0, _Unit.currencyCalc)(props, 'Households', undefined, true, true); | ||
}; // Generate Trips | ||
@@ -81,3 +81,3 @@ | ||
var Trips = function Trips(props) { | ||
return (0, _Unit.currencyCalc)(props, 'Trips', undefined, true); | ||
return (0, _Unit.currencyCalc)(props, 'Trips', undefined, true, true); | ||
}; // Generate Households | ||
@@ -84,0 +84,0 @@ |
{ | ||
"name": "@wfp/ui", | ||
"version": "0.17.90", | ||
"version": "0.17.93", | ||
"description": "WFP UI Kit Next", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2", |
@@ -43,3 +43,3 @@ import React from 'react'; | ||
export const currencyCalc = (props, after, before, afterSingular) => { | ||
export const currencyCalc = (props, after, before, afterSingular, isAbsolute) => { | ||
const { | ||
@@ -80,3 +80,5 @@ children, | ||
minimumFractionDigits: | ||
maximumFractionDigits === 0 | ||
isAbsolute === true | ||
? minimumFractionDigits === 0 | ||
: maximumFractionDigits === 0 | ||
? 0 | ||
@@ -89,3 +91,5 @@ : minimumFractionDigits | ||
maximumFractionDigits: | ||
value <= 0.005 | ||
isAbsolute === true | ||
? maximumFractionDigits === 0 | ||
: value <= 0.005 | ||
? 4 | ||
@@ -92,0 +96,0 @@ : value <= 0.05 |
@@ -14,3 +14,3 @@ import React from 'react'; | ||
export const People = props => { | ||
return currencyCalc(props, 'Partners', undefined, true); | ||
return currencyCalc(props, 'People', undefined, true, true); | ||
}; | ||
@@ -20,3 +20,3 @@ | ||
export const Partners = props => { | ||
return currencyCalc(props, 'Partners', undefined, true); | ||
return currencyCalc(props, 'Partners', undefined, true, true); | ||
}; | ||
@@ -41,3 +41,3 @@ | ||
export const Beneficiaries = props => { | ||
return currencyCalc(props, 'Beneficaries', undefined, true); | ||
return currencyCalc(props, 'Beneficaries', undefined, true, true); | ||
}; | ||
@@ -47,3 +47,3 @@ | ||
export const Households = props => { | ||
return currencyCalc(props, 'Households', undefined, true); | ||
return currencyCalc(props, 'Households', undefined, true, true); | ||
}; | ||
@@ -53,3 +53,3 @@ | ||
export const Trips = props => { | ||
return currencyCalc(props, 'Trips', undefined, true); | ||
return currencyCalc(props, 'Trips', undefined, true, true); | ||
}; | ||
@@ -56,0 +56,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
10098525
32547