@cloudflare/util-formatters
Advanced tools
Comparing version 2.6.15 to 2.7.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.7.0](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/util-formatters@2.6.15...@cloudflare/util-formatters@2.7.0) (2021-11-29) | ||
### Features | ||
* **stratus:** EW-5929 Integrate percentage view for chart legend ([7fecfd9](http://stash.cfops.it:7999/fe/stratus/commits/7fecfd9)) | ||
## [2.6.15](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/util-formatters@2.6.14...@cloudflare/util-formatters@2.6.15) (2021-11-23) | ||
@@ -8,0 +19,0 @@ |
@@ -70,1 +70,2 @@ import { SupportedLocales } from '@cloudflare/intl-core'; | ||
export declare const capitalizeStr: (str: string) => string | undefined; | ||
export declare const formatPercentage: (value: number, total: number) => string; |
@@ -166,2 +166,3 @@ import { format as d3Format } from 'd3-format'; | ||
}; | ||
export const capitalizeStr = str => str && str.charAt(0).toUpperCase() + str.slice(1); | ||
export const capitalizeStr = str => str && str.charAt(0).toUpperCase() + str.slice(1); | ||
export const formatPercentage = (value, total) => `${Math.round(value * 100 / total * 100) / 100}%`; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.capitalizeStr = exports.formatNumberForAnalytics = exports.formatBits = exports.formatBytes = exports.formatCurrency = exports.formatNumber = exports.localizeNumberWithPrecision = exports.formatDate = exports.DateFormatters = void 0; | ||
exports.formatPercentage = exports.capitalizeStr = exports.formatNumberForAnalytics = exports.formatBits = exports.formatBytes = exports.formatCurrency = exports.formatNumber = exports.localizeNumberWithPrecision = exports.formatDate = exports.DateFormatters = void 0; | ||
@@ -225,2 +225,8 @@ var _d3Format = require("d3-format"); | ||
exports.capitalizeStr = capitalizeStr; | ||
exports.capitalizeStr = capitalizeStr; | ||
var formatPercentage = function formatPercentage(value, total) { | ||
return "".concat(Math.round(value * 100 / total * 100) / 100, "%"); | ||
}; | ||
exports.formatPercentage = formatPercentage; |
{ | ||
"name": "@cloudflare/util-formatters", | ||
"description": "", | ||
"version": "2.6.15", | ||
"version": "2.7.0", | ||
"types": "./dist/index.d.ts", | ||
@@ -24,3 +24,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "33e724b3b47f1a0afbbf27e0e868959b34e04945" | ||
"gitHead": "46e16cc7018fe9cf0cde631e409f4d06b4441af7" | ||
} |
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
32072
430