当前位置:网站首页>Decimal format decimal / datetime conversion processing

Decimal format decimal / datetime conversion processing

2022-04-23 16:53:00 Tassel 1990

decimal numberString=0.266254M;

NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
nfi.NumberDecimalDigits=6;
Console.WriteLine( numberString.ToString( "F", nfi ) ); // 123

decimal Output to after formatting JSON Will automatically skip the back 0. Need to transfer string Handle

Object Of Time entity Use ToString() Will miss milliseconds .

May adopt Convert.ToDateTime(obj) transformation .

版权声明
本文为[Tassel 1990]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231359253886.html