formatValueWithSymbol
주어진 숫자 또는 문자열
에 주어진 기호
를 추가하고, 기호의 위치를 지정합니다.
Code
Interface
typescript
function formatValueWithSymbol(value: number | string, options: {
prefix?: string;
suffix?: string;
}): string
Usage
typescript
import { formatValueWithSymbol } from '@modern-kit/utils';
formatValueWithSymbol(1234567, { suffix: '원' });
// '1234567원'
formatValueWithSymbol(1234567, { prefix: '$' });
// '$1234567'
formatValueWithSymbol(1234567, { prefix: '*', suffix: '@' });
// '*1234567@'