Parcourir la source

Fix negative

Make word positive when making negative a negative number.
master
TheoryOfNekomata il y a 9 mois
Parent
révision
8140cda623
1 fichiers modifiés avec 4 ajouts et 3 suppressions
  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 Voir le fichier

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

Chargement…
Annuler
Enregistrer