import { tryParseFloat } from './' ; param { string } str param { boolean } addPostfix param { string | number } fallback export function tryParsePercentage ( str , addPostfix = true , fallback ) { const parsed = tryParseFloat ( str , fallback ) ; if ( parsed === fallback ) { return fallback ; } const percentage = ( parsed as number ) * 100 ; return addPostfix ? `${ percentage }%` : percentage ; }