public static SqlDecimal Power(SqlDecimal n, double exp) { if (n.IsNull) { return Null; } return new SqlDecimal(Math.Pow(n.ToDouble(), exp)); }
public static SqlString ConvertToChineseMoney(SqlDecimal money) { // 在此处放置代码 return new SqlString(ConvertToChinese(money.ToDouble())); }
// Power - Compute the power of a numeric /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public static SqlDecimal Power(SqlDecimal n, double exp) { n.AssertValid(); if (n.IsNull) return SqlDecimal.Null; byte prec = n.Precision; int scale = n.Scale; double dBaseNum = n.ToDouble(); n = new SqlDecimal(Math.Pow(dBaseNum, exp)); n.AdjustScale(scale - (int)n.Scale, true); n.m_bPrec = MaxPrecision; return n; }
public static SqlByte op_Explicit(SqlDecimal x) { if(x.IsNull) return SqlByte.Null; double val = x.ToDouble(); if (val < 0 || val > 255) throw new OverflowException("Arithmetic Overflow."); return new SqlByte((byte)val); }
public static SqlDecimal Power(SqlDecimal n, double exp) { if (n.IsNull) { return Null; } byte precision = n.Precision; int scale = n.Scale; double x = n.ToDouble(); n = new SqlDecimal(Math.Pow(x, exp)); n.AdjustScale(scale - n.Scale, true); n.m_bPrec = MaxPrecision; return n; }