小数点格式化

int i = 1;
var v = string.Format("{0}{1:D"+i+"}","0.", 0);
var vd = decimal.Round(decimal.Parse(v), i);
var vstr = vd.ToString();

v="0.0"

vd=0.0

vstr="0.0"

posted @ 2018-10-16 12:14  ligl007  阅读(...)  评论(...编辑  收藏