如何使用vb.net在datagridview中将数字格式化为3位小数 [英] How to format numbers to 3 decimal place in datagridview using vb.net

查看:403
本文介绍了如何使用vb.net在datagridview中将数字格式化为3位小数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用datagridview的vb.net窗体表单应用程序。我希望找到一个简单的方法来格式化某些datagridview单元格数字多达3小数位。这是我迄今为止所做的,但似乎没有正确地格式化一切。

  DataGridView1.Columns(3).DefaultCellStyle.Format =#。###
解决方案

  DataGridView1.Columns(2).DefaultCellStyle.Format =N3

这也许有帮助:


I have a vb.net windows forms application that is using a datagridview. I'm hoping to find a simple way to format certain datagridview cells numbers upto 3 decimal places. This is what I have done so far, but it doesn't seem to format everything correctly.

DataGridView1.Columns(3).DefaultCellStyle.Format = "#.###" 

解决方案

Do you try with this one?

DataGridView1.Columns(2).DefaultCellStyle.Format = "N3"

Also this one may helpful:

这篇关于如何使用vb.net在datagridview中将数字格式化为3位小数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆