Skip to main content

formatValueWithSymbol

A function that adds a given symbol to a given number or string and specifies the position of the symbol.


Code

🔗 View source 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@'