using System;struct Currency
{
    public uint Dollars;
    public ushort Cents;    public Currency(uint dollars,ushort cents)
    {
        this.Dollars = dollars;
        this.Cents = cents;
    }    public override string ToString()
    {
        return string.Format("${0}.{1,-2:00}",Dollars,Cents);
    }    public static implicit operator float(Currency cen1)
    { 
    return cen1.Dollars+(cen1.Cents/100f);
    }    public static explicit operator Currency(float flt)
    {
        uint dollars = (uint)flt;//3.03 3
        ushort cents = (ushort)((flt - dollars) * 100);
        string str = (flt - dollars).ToString();//0.02999997这个数字是从哪里计算出来的????
        return new Currency(dollars, cents);
    }
    static void Main()
    {
        Currency cen1 = new Currency(3, 3);
        float flt = cen1;
        Currency cen2 = (Currency)flt;
        Console.WriteLine(cen2.ToString());//$3.02
        Console.ReadKey();
    }
}