// MathToRoundUp.cpp : メイン プロジェクト ファイルです。

#include "stdafx.h"

using namespace System;

static double ToRoundUp(double dValue, int iDigits) {
	double dCoef = System::Math::Pow(10, iDigits);
	
	return dValue > 0 ? System::Math::Ceiling(dValue * dCoef) / dCoef:
		System::Math::Floor(dValue * dCoef) / dCoef;
}

int main(array<System::String ^> ^args)
{
	// 有効小数桁数が小数第 2 位になるように切り上げる
	double dValue = ToRoundUp(12.324, 2);
	// 切り上げした結果を表示する
	Console::WriteLine(dValue);  //12.33
	
	return 0;
}