瀏覽代碼

Fix negative

Make word positive when making negative a negative number.
master
TheoryOfNekomata 10 月之前
父節點
當前提交
8140cda623
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. +4
    -3
      packages/core/src/systems/en-US/short-count/stringify.ts

+ 4
- 3
packages/core/src/systems/en-US/short-count/stringify.ts 查看文件

@@ -324,6 +324,7 @@ export const mergeTokens = (tokens: string[], options?: MergeTokensOptions) => (
* Makes a negative string.
* @param s - The string to make negative.
*/
export const makeNegative = (s: string) => (
`${NEGATIVE} ${s}`
);
export const makeNegative = (s: string) => {
const negativePrefix = `${NEGATIVE} `;
return s.startsWith(negativePrefix) ? s.slice(negativePrefix.length) : `${negativePrefix}${s}`;
};

Loading…
取消
儲存