幽梦紫曦

类型转换

电脑版发表于:2020/3/31 15:12
  1. 将字符串转成double类型

  2. public static double ToDouble(this string source, double defaultValue)

  3.         {

  4.             if (!string.IsNullOrEmpty(source))

  5.             {

  6.                 double result;

  7.                 if (Double.TryParse(source, out result))

  8.                 {

  9.                     return result;

  10.                 }

  11.             }

  12.             return defaultValue;

  13.         }


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢