分配十进制值 [英] Assigning Decimal value

查看:96
本文介绍了分配十进制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在用Fedex Web服务开发一个Asp.Net应用程序.当我为联邦快递的重量信息赋值时,我遇到了一些问题.

Hi everybody,

I am developing an Asp.Net application with Fedex web services. When i assign value to the Fedex weight information i get some problem.

decimal packweight = 10.5M;
request.RequestedShipment.RequestedPackageLineItems[0].Weight.Value = packweight;



在上面的代码中,我将packweight小数变量值设置为fedex权重.但是它出现了一些错误.架构验证请求失败.



In the above code i set packweight decimal variable value to the fedex Weight. But its getting some error. Schema validation failed to request.

request.RequestedShipment.RequestedPackageLineItems[0].Weight.Value = 10.5M;



在上面的代码中,我直接分配权重值.它的工作正常,我得到了联邦快递费率服务的响应.在我的应用程序中,我想动态获取重量值并将其设置为Fedex.请帮助我解决该错误.



In the above code i directly assign the Weight value. Its working fine and i get the rerponse from the Fedex Rate services. In my application i want to dynamically get the weight value and set to the Fedex. Kindly assist me to fix the error.

推荐答案

您尝试使用float代替了吗?
Have you tried to use float instead??


这篇关于分配十进制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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