Rounder



( ZN >= 4.0.1-EIP )

It is the library created for rounding operations in numerical expressions.

 

 

# Methods


float up ( Float $ number , Int $ count = 0 )
float down ( Float $ number , Int $ count = 0 )
float average ( Float $ number , Int $ count = 0 )

 

 

# Up ( ZN >= 4.0.1-EIP )

The specified number rounds up .

Parameters

float $ Number Digital data.
Int $ count = 0 Number of decimals.
return float

uses

\Output::writeLine( Rounder::up(1.5) );
\Output::writeLine( Rounder::up(1.5, 2) );
\Output::writeLine( Rounder::up(1.523454321, 3) ); 
2
1.6
1.524 

 

 

# Down ( ZN >= 4.0.1-EIP )


Rolls the specified number down .

Parameters

float $ Number Digital data.
Int $ count = 0 Number of decimals.
return float

uses

\Output::writeLine( Rounder::down(1.5) );
\Output::writeLine( Rounder::down(1.5, 2) );
\Output::writeLine( Rounder::down(1.523454321, 3) ); 
1
1.5
1.523 

 

 

# Average ( ZN> = 4.0.1-EIP )


The decimal part of the specified number is rounded up from .5   to below and up to .5 above.

Parameters

float $ Number Digital data.
Int $ count = 0 Number of decimals.
return float

uses

\Output::writeLine( Rounder::average(1.5) );
\Output::writeLine( Rounder::average(1.4) );
\Output::writeLine( Rounder::average(1.54) ); 
2
1
2