C# 클래스 Example.Utilities.Extensions.DecimalExtensions

파일 보기 프로젝트 열기: feanz/Utilities

공개 메소드들

메소드 설명
DigitAtPosition ( this number, int position ) : int

Method that finds a digit at an arbirary position of a decimal. The number. The position of the digit to the right of the decimal (1-n). Digit at position var number = 1.2459m; var digit = number.DigitAtPosition(3); // value is 5 See also http://stackoverflow.com/questions/2923510/what-is-the-best-way-to-find-the-digit-at-n-position-in-a-decimal-number/2924042#2924042.

EnsurePositive ( this number ) : decimal

Ensures that the specified decimal is positive

비공개 메소드들

메소드 설명
SanitizedDigitAtPosition ( this sanitizedNumber, int validPosition ) : int

메소드 상세

DigitAtPosition() 공개 정적인 메소드

Method that finds a digit at an arbirary position of a decimal. The number. The position of the digit to the right of the decimal (1-n). Digit at position var number = 1.2459m; var digit = number.DigitAtPosition(3); // value is 5 See also http://stackoverflow.com/questions/2923510/what-is-the-best-way-to-find-the-digit-at-n-position-in-a-decimal-number/2924042#2924042.
public static DigitAtPosition ( this number, int position ) : int
number this
position int
리턴 int

EnsurePositive() 공개 정적인 메소드

Ensures that the specified decimal is positive
public static EnsurePositive ( this number ) : decimal
number this The decimal we are ensuring is positive.
리턴 decimal