C# 클래스 Redzen.Structures.Compact.FixedPointDecimal

A fixed point decimal data type that has the following qualities: 1) Uses a Int32 to hold the value (4 bytes versus the native decimal's 16 bytes). 2) Defines a fixed number of six digits after the decimal place. 3) Allows a null value to be represented, requiring a single bit to allocated for this. The range of FixedPointDecimal is -1,073.741823 to 1,073.741823. This can therefore represent all possible values in the SQL data type decimal(9,6). The range takes into into account the null bit and the fixed four digits after the decimal place. Fixed point maths also has the benefit of allowing for far simpler/faster comparison.
파일 보기 프로젝트 열기: colgreen/Redzen 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Null FixedPointDecimal

공개 메소드들

메소드 설명
Compare ( FixedPointDecimal d1, FixedPointDecimal d2 ) : int

Compares two specified FixedPointDecimal values.

Create ( decimal d ) : FixedPointDecimal

Static factory method to create a FixedDecimal.

Equals ( FixedPointDecimal d1, FixedPointDecimal d2 ) : bool

Determines whether the specified FixedPointDecimal is equal to the current FixedPointDecimal.

Equals ( object value ) : bool

Determines whether the specified Object is equal to the current Object.

FixedPointDecimal ( decimal val ) : System

Construct FixedPointDecimal from the provided nullable decimal.

GetHashCode ( ) : int

Gets the hash code for the object.

TryParse ( string s, FixedPointDecimal &result ) : bool

Converts the string representation of a number to its FixedPointDecimal equivalent. A return value indicates whether the conversion succeeded or failed.

TryParseTruncate ( string s, FixedPointDecimal &result ) : bool

Converts the string representation of a number to its FixedPointDecimal equivalent. A return value indicates whether the conversion succeeded or failed. Values outside the range of a FixedPointDecimal are truncated to the min or max values for FixedPointDecimal as appropriate. Input values with more than four decimal places have their precision truncated to to four decimal places.

operator ( ) : bool

Determines if two FixedPointDecimal objects are not equal.

비공개 메소드들

메소드 설명
FixedPointDecimal ( uint significand, bool isNegative ) : System
InternalTryParse ( string s, FixedPointDecimal &result, bool truncateRange ) : bool

메소드 상세

Compare() 공개 정적인 메소드

Compares two specified FixedPointDecimal values.
public static Compare ( FixedPointDecimal d1, FixedPointDecimal d2 ) : int
d1 FixedPointDecimal The first to compare.
d2 FixedPointDecimal The second to compare.
리턴 int

Create() 공개 정적인 메소드

Static factory method to create a FixedDecimal.
public static Create ( decimal d ) : FixedPointDecimal
d decimal The value to create the object from.
리턴 FixedPointDecimal

Equals() 공개 정적인 메소드

Determines whether the specified FixedPointDecimal is equal to the current FixedPointDecimal.
public static Equals ( FixedPointDecimal d1, FixedPointDecimal d2 ) : bool
d1 FixedPointDecimal The first to compare.
d2 FixedPointDecimal The second to compare.
리턴 bool

Equals() 공개 메소드

Determines whether the specified Object is equal to the current Object.
public Equals ( object value ) : bool
value object The object to compare with the current object.
리턴 bool

FixedPointDecimal() 공개 메소드

Construct FixedPointDecimal from the provided nullable decimal.
public FixedPointDecimal ( decimal val ) : System
val decimal The value to convert.
리턴 System

GetHashCode() 공개 메소드

Gets the hash code for the object.
public GetHashCode ( ) : int
리턴 int

TryParse() 공개 정적인 메소드

Converts the string representation of a number to its FixedPointDecimal equivalent. A return value indicates whether the conversion succeeded or failed.
public static TryParse ( string s, FixedPointDecimal &result ) : bool
s string The value to parse.
result FixedPointDecimal Upon success contains the equivalent of the value of .
리턴 bool

TryParseTruncate() 공개 정적인 메소드

Converts the string representation of a number to its FixedPointDecimal equivalent. A return value indicates whether the conversion succeeded or failed. Values outside the range of a FixedPointDecimal are truncated to the min or max values for FixedPointDecimal as appropriate. Input values with more than four decimal places have their precision truncated to to four decimal places.
public static TryParseTruncate ( string s, FixedPointDecimal &result ) : bool
s string The value to parse.
result FixedPointDecimal Upon success contains the equivalent of the value of .
리턴 bool

operator() 공개 정적인 메소드

Determines if two FixedPointDecimal objects are not equal.
public static operator ( ) : bool
리턴 bool

프로퍼티 상세

Null 공개적으로 정적으로 프로퍼티

Public static instance of a null FixedPointDecimal.
public static FixedPointDecimal,Redzen.Structures.Compact Null
리턴 FixedPointDecimal