| 343 | * @returns {string} The resolved unit symbol string |
| 344 | */ |
| 345 | export function resolveSymbol(actualStandard, bits, e, isDecimal) { |
| 346 | const symbolTable = STRINGS.symbol[actualStandard][bits ? BITS : BYTES]; |
| 347 | let result; |
| 348 | if (isDecimal && e === 1) { |
| 349 | if (bits) { |
| 350 | result = SI_KBIT; |
| 351 | } else { |
| 352 | result = SI_KBYTE; |
| 353 | } |
| 354 | } else { |
| 355 | result = symbolTable[e]; |
| 356 | } |
| 357 | return result; |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * Decorates the result: applies negation, custom symbols, number formatting, and full form names |