decimal扩展方法(转换为字符串,去掉末尾的0)

        /// <summary>
        /// 转换为字符串,去掉末尾0
        /// </summary>
        /// <param name="target">被转换的对象</param>
        /// <returns>去掉末尾0的decimal</returns>
        public static string RemoveLastZero(this decimal target)
        {
            return target.ToString("G0");
        }

 

posted @ 2016-01-05 11:04  直钩钓鱼  阅读(1669)  评论(0编辑  收藏  举报