close
語言:C#
功能:無條件捨去
語法:

public static double NoRound(double num, int post)
  {
         double nReturn;
         double nPow;
          if (post <= 0 )
          {
              nReturn = Math.Floor(num);
          }
          else
          {
              nPow = Math.Pow(10, post);
              nReturn = Math.Floor(num * nPow)/nPow;
          }
          return nReturn;
}

arrow
arrow
    全站熱搜

    janema66 發表在 痞客邦 留言(2) 人氣()