private decimal? xposition;
public decimal? XPosition
{
get
{
return this.xposition;
}
set
{
this.xposition = value;
Math.Round(this.xposition, 4);
}
}
爲什麼我不能在set方法中使用Math.round
?它說:爲什麼我不能在set方法中使用Math.round#
參數'#1'不能轉換'小數?'表達式爲'double'
請問您可以粘貼相關代碼嗎? – Bathsheba
私有小數? xPosition位置; –
私有小數? xPosition位置; \t \t public decimal? x向位置 \t \t { \t \t \t得到 \t \t \t { \t \t \t \t回報this.xposition; \t \t \t} \t \t \t設置 \t \t \t \t {\t \t \t \t \t \t \t this.xposition =值; \t \t \t \t Math.Round(this.xposition,4); \t \t \t \t} \t \t \t \t} –