如何更改十进制格式

时间:2018-12-18 08:14:27

标签: c#

我想更改小数点分隔符 我更改了位置,但仍然没有改变

当前结果 100,200.00 预期结果 100.200,00

item.currentAmount.ToString(string.Format(new CultureInfo("pt-BR"), "{0:N2}"));

1 个答案:

答案 0 :(得分:3)

您可以尝试使用string.Format覆盖方法

  

Format(IFormatProvider,String,Object)

在第一个参数上设置区域性。

select avg(audit_main.score)
from `audit_main`
inner join `farmer_details` on `audit_main`.`id` = `farmer_details`.`audit_main_id` 
inner join `farmers` on `farmer_details`.`farmer_id` = `farmers`.`user_id`  
inner join `address` on `farmers`.`address_id` = `address`.`id`  
where `audit_main`.`certification_id` = 4
     and `farmer_details`.`mill_id` = 22  
     and `farmer_details`.`administrative_division_id` = 166
     and `address`.`village_id` = 139543;

c# online