本帖最后由 smss 于 2019-7-17 13:22 编辑
文本A.xml中有大量数值需要除以1.5后再用 有余数时4舍5入保留小数点后2位
例句- <Button name="clean" y="#sh-940/1.5" w="270/1.5" h="235/1.5" alignV="bottom" alignChildren="true">
- <Rectangle w="270/1.5" h="235/1.5" fillColor="#ffffff" strokeColor="#cdcdcd" />
- </Button>
复制代码 生成- <Button name="clean" y="#sh-626.67" w="180" h="156.67" alignV="bottom" alignChildren="true">
- <Rectangle w="180" h="156.67" fillColor="#ffffff" strokeColor="#cdcdcd" />
- </Button>
复制代码 计算所有""之间数值 运算符含+-*/ (加减乘除 还有取模函数等等 就不涉及了)
例如x="65+5" 调试时加的5 这样一多,一个个改太费事 因此想批量计算后替换掉原来的值 以减少程序计算量 提高效率 |