# Documentation

Menu

## Number extends QRDataModeAbstract
in package

FinalYes
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

#### Constants

DATAMODE = \chillerlan\QRCode\Common\Mode::NUMBER
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 : string
  The data to write

#### Methods

__construct() : mixed
  QRDataModeAbstract constructor.
convertEncoding() : string
  encoding conversion helper
decodeSegment() : string
getLengthInBits() : int
validateString() : bool
write() : QRDataModeInterface
getCharCount() : int
  returns the character count of the $data string
getLengthBits() : int
  shortcut
parseInt() : int
  get the code for the given numeric string

### Constants

#### DATAMODE

Number.php : 35
`public mixed DATAMODE = \chillerlan\QRCode\Common\Mode::NUMBER`

##### Tags

inheritDoc

#### 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 : 23

The data to write

`protected string $data`

### Methods

#### __construct()

QRDataModeAbstract.php : 30

QRDataModeAbstract constructor.

`public __construct(string $data) : mixed`

##### Parameters

$data : string

##### Tags

throws
  QRCodeDataException

#### convertEncoding()

QRDataModeAbstract.php : 50

encoding conversion helper

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

##### Parameters

$string : string

##### Tags

inheritDoc

##### Return values

string

#### decodeSegment()

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

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Tags

inheritDoc
throws
  QRCodeDataException

##### Return values

string

#### 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) : QRDataModeInterface`

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Tags

inheritDoc

##### Return values

QRDataModeInterface

#### getCharCount()

QRDataModeAbstract.php : 43

returns the character count of the $data string

`protected getCharCount() : int`

##### Return values

int

#### getLengthBits()

QRDataModeAbstract.php : 57

shortcut

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

##### Parameters

$versionNumber : int

##### Return values

int

#### parseInt()

Number.php : 100

get the code for the given numeric string

`private parseInt(string $string) : int`

##### Parameters

$string : string

##### Return values

int

## Search results