Hbars

new Hbar(<amount>)

Hbar from:

Construct hbars from different representations.

Java
//100 hbars converted to tinybars
Hbar.from(100, HbarUnit.Tinybar);

//Hbars from tinybars
Hbar.fromTinybar(100);

//v1.3.2
JavaScript
//100 hbars converted to tinybars
Hbar.from(100, HbarUnit.Tinybar);

//Hbars from tinybars
Hbar.fromTinybar(100);

//v1.4.4

Hbar to:

Convert hbars to a different unit/format.

Java
//100 hbars converted to tinybars
new Hbar(100).as(HbarUnit.Tinybar);

//100 hbars converted to tinybars
new Hbar(100).toTinybars();

//v1.3.2
JavaScript
//100 hbars converted to tinybars
new Hbar(100).as(HbarUnit.Tinybar);

//100 hbars converted to tinybars
new Hbar(100).toTinybars();

//v1.4.4

Hbar constants:

Provided constant values of hbars.

Java
//The maximum number of hbars
Hbar hbarMax = Hbar.MAX; 

//The minimum number of hbars
Hbar hbarMin = Hbar.MIN;

//Zero hbars
Hbar hbarZero = Hbar.ZERO; 

//v1.3.2
JavaScript
//The maximum number of hbars
const hbarMax = Hbar.MAX; 

//The minimum number of hbars
const hbarMin = Hbar.MIN;

//Zero hbars
const hbarZero = Hbar.ZERO; 

//v1.4.4

Hbar units

Modify the hbar representation to one of the hbar denominations.

Java
Hbar.from(100, HbarUnit.Tinybar);

//v1.3.2
JavaScript
Hbar.from(100, HbarUnit.Tinybar);

//v1.4.4

Last updated