/// <summary> /// 元转分 /// </summary> /// <param name="yuan">元</param> public static int ToFen(decimal?yuan) => yuan == null ? 0 : Conv.ToInt(CutDecimalWithN(yuan.Value, 2) * 100, 0);
/// <summary> /// 元转分 /// </summary> /// <param name="yuan">元</param> public static int ToFen(decimal yuan) => Conv.ToInt(CutDecimalWithN(yuan, 2) * 100, 0);
/// <summary> /// 分转元 /// </summary> /// <param name="fen">分</param> public static decimal ToYuan(int fen) => Conv.ToDecimal((decimal)fen / 100, 2);
/// <summary> /// 分转元 /// </summary> /// <param name="fen">分</param> public static decimal ToYuan(int?fen) => fen == null ? 0 : Conv.ToDecimal((decimal)fen / 100, 2);
/// <summary> /// 设置时间 /// </summary> /// <param name="dateTime">时间</param> public static void SetTime(string dateTime) => _dateTime = Conv.ToDateOrNull(dateTime);