# Class: com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter

A number formatter used to format immediates. 

 Notes: 
 
- max 64\-bit long 
- signedness: applicable to octal/decimal/hexadecimal, N/A for binary/ascii

## Constructor: NumberFormatter

Description: Create a hexadecimal unsigned number formatter.

## Constructor: NumberFormatter
- parameter: `defaultNumberFormatter`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter`

Description: Create a number formatter by copying another formatter.
parameter: defaultNumberFormatter: formatter to copy

## Method: format
- parameter: `bitsize`, type: `int`
- parameter: `rawValue`, type: `long`
- return type: `java.lang.String`

Description: Format a number using the formatter's current settings.
parameter: bitsize: value size in bits
parameter: rawValue: raw value
return: formatted value

## Method: format
- parameter: `bitsize`, type: `int`
- parameter: `rawValue`, type: `long`
- parameter: `base`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.NumberBase`
- parameter: `treatAsSignedNumber`, type: `boolean`
- return type: `java.lang.String`

Description: Format a number.
parameter: bitsize: value size in bits
parameter: rawValue: raw value
parameter: base: rendering base
parameter: treatAsSignedNumber: true to treat the value as signed
return: formatted value

## Method: format
- parameter: `bitsize`, type: `int`
- parameter: `rawValue`, type: `java.math.BigInteger`
- return type: `java.lang.String`

Description: Format a large number using the formatter's current settings.
parameter: bitsize: value size in bits
parameter: rawValue: raw value
return: formatted value

## Method: format
- parameter: `bitsize`, type: `int`
- parameter: `rawValue`, type: `java.math.BigInteger`
- parameter: `base`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.NumberBase`
- parameter: `treatAsSignedNumber`, type: `boolean`
- return type: `java.lang.String`

Description: Trivial implementation of a BigInteger formatter. Reverts to using [#format(int, long, NumberBase, boolean)](#format(int, long, NumberBase, boolean)) if bitsize is `<= 64`.
parameter: bitsize: value size in bits
parameter: rawValue: raw value
parameter: base: rendering base
parameter: treatAsSignedNumber: true to treat the value as signed
return: formatted value

## Method: getBase
- return type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.NumberBase`

Description: Retrieve the rendering base.
return: rendering base

## Method: getEndianness
- return type: `com.pnfsoftware.jeb.util.io.Endianness`

Description: Retrieve endianness. Use
return: endianness

## Method: getForcePositiveRenderingForNonBase10
- return type: `boolean`

Description: Determine whether positive rendering is forced for non\-base\-10 values.
return: true if enabled

## Method: getHexaNotationType
- return type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.HexaNotationType`

Description: Retrieve the hexadecimal notation style.
return: hexadecimal notation style

## Method: hasConstantsFormatterOverride
- return type: `boolean`

Description: Determine whether a constants formatter override is set.
return: true if an override is set

## Method: isSignedNumber
- return type: `boolean`

Description: Determine whether numbers are treated as signed.
return: true if signed rendering is enabled

## Method: rotateBase
- return type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.NumberBase`

Description: Rotate to the next rendering base.
return: new rendering base

## Method: setBase
- parameter: `base`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.NumberBase`

Description: Set the rendering base.
parameter: base: rendering base

## Method: setConstantsFormatterOverride
- parameter: `cf`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.ConstantsFormatter`

Description: Set a constants formatter override.
parameter: cf: constants formatter, or null

## Method: setEndianness
- parameter: `endianness`, type: `com.pnfsoftware.jeb.util.io.Endianness`

Description: Change endianness. Note that default [NumberFormatter](NumberFormatter) consider that data is Little Endian ordered \(meaning that ascii representation will be flipped in comparison to raw value\).
parameter: endianness: endianness

## Method: setForcePositiveRenderingForNonBase10
- parameter: `enabled`, type: `boolean`

Description: Force positive rendering for non\-base\-10 values.
parameter: enabled: true to force positive rendering

## Method: setHexaNotationType
- parameter: `hexaNotationType`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.HexaNotationType`

Description: Set the hexadecimal notation style.
parameter: hexaNotationType: hexadecimal notation style

## Method: setSignedNumber
- parameter: `signedNumber`, type: `boolean`

Description: Set whether numbers should be treated as signed.
parameter: signedNumber: true to render as signed

