Quellcode durchsuchen

Fix negative

Make word positive when making negative a negative number.
master
TheoryOfNekomata vor 1 Jahr
Ursprung
Commit
8140cda623
1 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
  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 Datei anzeigen

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

Laden…
Abbrechen
Speichern