import React from 'react' import { type Meta } from '@storybook/react-vite' import { largeNumConversion } from '../../services/HelperServiceTyped' import { DocsTemplate } from '../../../.storybook' import OutputForDemo from '../../../.storybook/templates/OutputForDemo' export const Example = (args: { /** The string or number that needs to be passed into this function. */ num: string | number }): React.JSX.Element => { const { val, suffix } = largeNumConversion(args.num) return ( Value: {val} Suffix: {suffix} } /> ) } Example.storyName = 'largeNumConversion' Example.args = { num: 1234567, } export default { title: 'Helper Functions/largeNumConversion', component: Example, parameters: { viewMode: 'docs', previewTabs: { canvas: { hidden: true }, }, docs: { page: () => ( <> largeNumConversion is used when you have large numbers (in the millions or billions) and you need to abbreviate them. , The val and suffix that will be returned should be used to format the desired number. , Note: This function will not format the number. The number will need to be formatted after getting these converted values. , ]} /> ), }, }, } as Meta