右对齐自定义货币数据网格视图
Align right custom currency datagridview
我想要一个具有特定货币格式的 datagridview 列:
用户输入:213
输出:vnt。 213
期望输出:213 vnt。
当前代码:
var vntformat = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
vntformat.CurrencySymbol = "vnt. ";
advancedDataGridView1.Columns[21].DefaultCellStyle.FormatProvider = vntformat;
advancedDataGridView1.Columns[21].DefaultCellStyle.Format = "c0";
如何将货币符号右对齐?
根据您希望如何处理 space
,将 CurrencyPositivePattern
更改为 3 或 1
vntformat.CurrencyPositivePattern = 1;
记录在此处
您可能还需要使用 CurrencyNegativePattern
指定希望它如何显示负数。这里显示了很多选项
我想要一个具有特定货币格式的 datagridview 列:
用户输入:213
输出:vnt。 213
期望输出:213 vnt。
当前代码:
var vntformat = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
vntformat.CurrencySymbol = "vnt. ";
advancedDataGridView1.Columns[21].DefaultCellStyle.FormatProvider = vntformat;
advancedDataGridView1.Columns[21].DefaultCellStyle.Format = "c0";
如何将货币符号右对齐?
根据您希望如何处理 space
,将CurrencyPositivePattern
更改为 3 或 1
vntformat.CurrencyPositivePattern = 1;
记录在此处
您可能还需要使用 CurrencyNegativePattern
指定希望它如何显示负数。这里显示了很多选项