0

当当前区域性在 c# 中设置为 id-ID 时,如何将以小数点开头的字符串转换为其十进制值

if (SessionHelper.Culture == "id-ID")
    {

        objGuestInvoiceDetail.DPSTransactionFee = Convert.ToDecimal(objParameter.ParameterValue);
    }


//objParameter.ParameterValue contains value=".80"
4

1 回答 1

0
if (SessionHelper.Culture == "id-ID")
    {

        objGuestInvoiceDetail.DPSTransactionFee = Convert.ToDecimal(String.Format("0{0}",objParameter.ParameterValue));
        //objGuestInvoiceDetail is ="0.80"
    }


//objParameter.ParameterValue contains value=".80"
于 2013-07-12T08:54:11.463 回答