/// <summary>
/// 输入Float格式数字,将其转换为货币表达方式
/// </summary>
/// <param name="ftype">货币表达类型:0=带¥的货币表达方式;1=不带¥的货币表达方式;其它=带¥的货币表达方式</param>
/// <param name="fmoney">传入的int数字</param>
/// <returns>返回转换的货币表达形式</returns>
public string Rmoney(int ftype, double fmoney)
{
string _rmoney;
try
{
switch (ftype)
{
case 0:
_rmoney = string.Format("{0:C2}", fmoney);
break;
case 1:
_rmoney = string.Format("{0:N2}", fmoney);
break;
default:
_rmoney = string.Format("{0:C2}", fmoney);
break;
}
}
catch
{
_rmoney = "";
}
return _rmoney;
}
/// <summary>
/// 输入Float格式数字,将其转换为货币表达方式
/// </summary>
/// <param name="ftype">货币表达类型:0=人民币;1=港币;2=美钞;3=英镑;4=不带货币;其它=不带货币表达方式</param>
/// <param name="fmoney">传入的int数字</param>
/// <returns>返回转换的货币表达形式</returns>
public static string ConvertCurrency(decimal fmoney)
{
CultureInfo cul = null;
int ftype=4;
string _rmoney=string.Empty;
try
{
switch (ftype)
{
case 0:
cul = new CultureInfo("zh-CN");//中国大陆
_rmoney = fmoney.ToString("c", cul);
break;
case 1:
cul = new CultureInfo("zh-HK");//香港
_rmoney = fmoney.ToString("c", cul);
break;
case 2:
cul = new CultureInfo("en-US");//美国
_rmoney = fmoney.ToString("c", cul);
break;
case 3:
cul = new CultureInfo("en-GB");//英国
_rmoney = fmoney.ToString("c", cul);
break;
case 4:
_rmoney = string.Format("{0:n}", fmoney);//没有货币符号
break;
default:
_rmoney = string.Format("{0:n}", fmoney);
break;
}
}
catch
{
_rmoney = "";
}
return _rmoney;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有