码迷,mamicode.com
首页 > Windows程序 > 详细

C#格式化数字

时间:2017-06-28 16:14:27      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:form   text   str1   mono   oca   res   tor   blog   mem   

        var t1 = Profiler.GetMonoHeapSize()/div;
        var t2 = Profiler.GetMonoUsedSize() / div;
        var t3 = Profiler.GetTotalAllocatedMemory() / div;
        var t4 = Profiler.GetTempAllocatorSize() / div;
        var t5 = Profiler.GetTotalReservedMemory() / div;
        var t6 = Profiler.GetTotalUnusedReservedMemory() / div;
        var t7 = Profiler.usedHeapSize / div;
        var t8 = Profiler.enabled;
//         var str = string.Format("f", 120.3457f);
//         var str1 = string.Format("g", 120.3457f);
//         var str2 = string.Format("{0:f}", 120.3457f);
//         var str3 = string.Format("{0:0.000}", 120.3457f);
//         var str4 = string.Format("{0:0000}", 120.3457f);
//         var str5 = string.Format("{0:0000}", 120);
        //var str7 = string.Format("{0:d4}", 120);

        text.text = "程序内存:" + t7.ToString("f") + ", monoHeap:" +t1.ToString("f") + ",monoUsed:" + t2.ToString("f")+ ",all:" + t3.ToString("g");

 

C#格式化数字

标签:form   text   str1   mono   oca   res   tor   blog   mem   

原文地址:http://www.cnblogs.com/timeObjserver/p/7090136.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!