2013年6月20日木曜日

decimalを整数型にキャストして小数点の切り捨て [C#]

decimalの小数点の切り捨て方法

--------------------------------------------------

decimal decitest;

~処理~

int intest = Decimal.ToInt32(decitest);

long longtest = Decimal.ToInt64(decitest);

--------------------------------------------------

decimalからならこれでいぃかφ(..)