C# 클래스 NExtends.Primitives.DoubleExtensions

파일 보기 프로젝트 열기: LuccaSA/NExtends

공개 메소드들

메소드 설명
Ceiling ( this d, int precision ) : Double
Floor ( this d, int precision ) : Double
RealRound ( this d, int precision ) : Double

Round number to given precision using mode MidpointRounding.AwayFromZero

ie: the normal maths rounding

For example: RealRound(0.165, 2) returns 0.17 and NOT 0.16

Round ( this d, int precision ) : Double

Round number to given precision using mode MidpointRounding.ToEven

If the one's digit is odd, it is changed to an even digit. Otherwise, it is left unchanged. This behavior follows IEEE Standard 754, section 4. It is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.

For example: Round(0.165, 2) returns 0.16 and NOT 0.17

More info on http://stackoverflow.com/questions/977796/in-c-math-round2-5-result-is-2-instead-of-3-are-you-kidding-me

ToJSON ( this d ) : String
tronquerDecimales ( this value ) : double

메소드 상세

Ceiling() 공개 정적인 메소드

public static Ceiling ( this d, int precision ) : Double
d this
precision int
리턴 Double

Floor() 공개 정적인 메소드

public static Floor ( this d, int precision ) : Double
d this
precision int
리턴 Double

RealRound() 공개 정적인 메소드

Round number to given precision using mode MidpointRounding.AwayFromZero

ie: the normal maths rounding

For example: RealRound(0.165, 2) returns 0.17 and NOT 0.16

public static RealRound ( this d, int precision ) : Double
d this
precision int
리턴 Double

Round() 공개 정적인 메소드

Round number to given precision using mode MidpointRounding.ToEven

If the one's digit is odd, it is changed to an even digit. Otherwise, it is left unchanged. This behavior follows IEEE Standard 754, section 4. It is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.

For example: Round(0.165, 2) returns 0.16 and NOT 0.17

More info on http://stackoverflow.com/questions/977796/in-c-math-round2-5-result-is-2-instead-of-3-are-you-kidding-me

public static Round ( this d, int precision ) : Double
d this
precision int
리턴 Double

ToJSON() 공개 정적인 메소드

public static ToJSON ( this d ) : String
d this
리턴 String

tronquerDecimales() 공개 정적인 메소드

public static tronquerDecimales ( this value ) : double
value this
리턴 double