Menu

## Number extends QRDataModeAbstract
in package

Number.php : 23

Numeric mode: decimal digits 0 to 9

ISO/IEC 18004:2000 Section 8.3.2 ISO/IEC 18004:2000 Section 8.4.2

### Table of Contents

NUMBER_TO_ORD = ['0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9]
$data : string
  The data to write
$datamode : int
  the current data mode: Num, Alphanum, Kanji, Hanzi, Byte
__construct() : mixed
  QRDataModeAbstract constructor.
convertEncoding() : string
  encoding conversion helper
decodeSegment() : string
getDataMode() : int
  returns the current data mode constant
getLengthInBits() : int
validateString() : bool
write() : void
getCharCount() : int
  returns the character count of the $data string
getLengthBits() : int
  shortcut
parseInt() : int
  get the code for the given numeric string

### Constants

#### NUMBER_TO_ORD

Number.php : 28
`private array<string|int, int> NUMBER_TO_ORD = ['0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9]`

### Properties

#### $data

QRDataModeAbstract.php : 28

The data to write

`protected string $data`

#### $datamode

Number.php : 35

the current data mode: Num, Alphanum, Kanji, Hanzi, Byte

`protected static int $datamode = \chillerlan\QRCode\Common\Mode::NUMBER`

##### Tags

inheritDoc

### Methods

#### __construct()

QRDataModeAbstract.php : 35

QRDataModeAbstract constructor.

`public __construct(string $data) : mixed`

##### Parameters

$data : string

##### Tags

throws
  QRCodeDataException

##### Return values

mixed —

#### convertEncoding()

QRDataModeAbstract.php : 62

encoding conversion helper

`public static convertEncoding(string $string) : string`

##### Parameters

$string : string

##### Tags

inheritDoc

##### Return values

string —

#### decodeSegment()

Number.php : 114
`public static decodeSegment(BitBuffer $bitBuffer, int $versionNumber) : string`

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Tags

inheritDoc
throws
  QRCodeDataException

##### Return values

string —

#### getDataMode()

QRDataModeAbstract.php : 55

returns the current data mode constant

`public getDataMode() : int`

##### Tags

inheritDoc

##### Return values

int —

#### getLengthInBits()

Number.php : 40
`public getLengthInBits() : int`

##### Tags

inheritDoc

##### Return values

int —

#### validateString()

Number.php : 47
`public static validateString(string $string) : bool`

##### Parameters

$string : string

##### Tags

inheritDoc

##### Return values

bool —

#### write()

Number.php : 65
`public write(BitBuffer $bitBuffer, int $versionNumber) : void`

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Tags

inheritDoc

##### Return values

void —

#### getCharCount()

QRDataModeAbstract.php : 48

returns the character count of the $data string

`protected getCharCount() : int`

##### Return values

int —

#### getLengthBits()

QRDataModeAbstract.php : 69

shortcut

`protected static getLengthBits(int $versionNumber) : int`

##### Parameters

$versionNumber : int

##### Return values

int —

#### parseInt()

Number.php : 99

get the code for the given numeric string

`private parseInt(string $string) : int`

##### Parameters

$string : string

##### Return values

int —

## Search results