# 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

#### Properties

$data : string
  The data to write

#### Methods

__construct() : mixed
  QRDataModeAbstract constructor.
convertEncoding() : string
  encoding conversion helper
decodeSegment() : string
  reads a segment from the BitBuffer and decodes in the current data mode
getLengthInBits() : int
  retruns the length in bits of the data string
validateString() : bool
  checks if the given string qualifies for the encoder module
write() : static
  writes the actual data string to the BitBuffer, uses the given version to determine the length bits
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 : 25
`public mixed DATAMODE = \chillerlan\QRCode\Common\Mode::NUMBER`

### Properties

#### $data

QRDataModeAbstract.php : 24

The data to write

`protected string $data`

### Methods

#### __construct()

QRDataModeAbstract.php : 31

QRDataModeAbstract constructor.

`public __construct(string $data) : mixed`

##### Parameters

$data : string

##### Tags

throws
  QRCodeDataException

#### convertEncoding()

QRDataModeAbstract.php : 48

encoding conversion helper

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

##### Parameters

$string : string

##### Return values

string

#### decodeSegment()

Number.php : 93

reads a segment from the BitBuffer and decodes in the current data mode

`public static decodeSegment(BitBuffer $bitBuffer, int $versionNumber) : string`

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Tags

inheritDoc
throws
  QRCodeDataException

##### Return values

string

#### getLengthInBits()

Number.php : 27

retruns the length in bits of the data string

`public getLengthInBits() : int`

##### Return values

int

#### validateString()

Number.php : 31

checks if the given string qualifies for the encoder module

`public static validateString(string $string) : bool`

##### Parameters

$string : string

##### Return values

bool

#### write()

Number.php : 35

writes the actual data string to the BitBuffer, uses the given version to determine the length bits

`public write(BitBuffer $bitBuffer, int $versionNumber) : static`

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Return values

static

#### getCharCount()

QRDataModeAbstract.php : 44

returns the character count of the $data string

`protected getCharCount() : int`

##### Return values

int

#### getLengthBits()

QRDataModeAbstract.php : 55

shortcut

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

##### Parameters

$versionNumber : int

##### Return values

int

#### parseInt()

Number.php : 72

get the code for the given numeric string

`private parseInt(string $string) : int`

##### Parameters

$string : string

##### Tags

throws
  QRCodeDataException

##### Return values

int

## Search results