简体   繁体   English

在flex中自动转换为两位小数

[英]Automatic convert to two decimal in flex

I am assigning a value to other variable like this in flex web application. 我正在为Flex Web应用程序中的其他变量分配一个值。 this.X = _cord - width ; this.X = _cord-width;

In debugger value of (_cord - width) is coming 95.9995874156354. 在调试器中,(_cord-width)的值将为95.9995874156354。 but after assigning it to this.X it automatically converts to 95.95. 但将其分配给this.X后,它将自动转换为95.95。

Please help me on this. 请帮我。

This is an inherent feature of coordinates in Flash player. 这是Flash Player中坐标的固有功能。 The minimal value of a coordinate increment is called "twip" and equals 0.05. 坐标增量的最小值称为“缇”,等于0.05。 So, use something else than coordinate property to store values with desired precision. 因此,使用除协调属性以外的其他方法来存储具有所需精度的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM