toBase

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.number

Convert a number to another base between 1 and the length of the “chars” settings

Params

  1. number*-Number

    The number to convert

  2. base*-Number

    The base to convert to

Return

  1. -String

    The converted number in string format

Example

import { toBase } from '@blackbyte/sugar/number'
toBase(1024, 62); // qF

Settings

  1. chars’abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789’String

    The characters set to use for conversion

Todo

  • testsnormal