Ver código fonte

Fix negative

Make word positive when making negative a negative number.
master
TheoryOfNekomata 9 meses atrás
pai
commit
8140cda623
1 arquivos alterados com 4 adições e 3 exclusões
  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 Ver arquivo

@@ -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}`;
};

Carregando…
Cancelar
Salvar