Break decimal up into 4 parts : Decimal « Data Type « Visual C++ .NET






Break decimal up into 4 parts

 


#include "stdafx.h"
using namespace System;

void main()
{
    Decimal a = (Decimal)123456789012345000000.00000000;
    Console::WriteLine( a );
 

    array<int>^ d = Decimal::GetBits(a);

    Console::WriteLine( d[0] );              
    Console::WriteLine( d[1] );              
    Console::WriteLine( d[2] );              
    Console::WriteLine( d[3].ToString("X") );


}

   
  








Related examples in the same category

1.Cast to decimal
2.Decimal calculation
3.Decimal constructor
4.Using Decimal constructor
5.Decimal literal assigned