@opendata-ai/openchart-core 6.15.1 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2464,7 +2464,11 @@ var D3_FORMAT_SUFFIX_RE = /^(.*~?[efgsrdxXobcnp%])(.+)$/;
2464
2464
  function buildD3Formatter(formatStr) {
2465
2465
  if (!formatStr) return null;
2466
2466
  try {
2467
- return format(formatStr);
2467
+ const fmt = format(formatStr);
2468
+ if (formatStr.includes("s")) {
2469
+ return (v) => fmt(v).replace(/G$/, "B");
2470
+ }
2471
+ return fmt;
2468
2472
  } catch {
2469
2473
  const m = formatStr.match(D3_FORMAT_SUFFIX_RE);
2470
2474
  if (m) {