-
-
高翔 初学数据Lv2
发表于2020-11-8 12:23
悬赏20
已解决
7个回答
我在外面加了一层if ,就像这样if(self.leftcell.value>0 ,if(self.leftcell.value<6.66*@mon,'vfs/root/products/ebi/sys/picture/红色.png',if(self.leftcell.6.66*@mon<value<7.5*@mon,'vfs/root/products/ebi/sys/picture/橙色.png',if(self.leftcell.7.5*@mon<value<8.33*@mon,'vfs/root/products/ebi/sys/picture/黄色.png',''')))),可是不对
哪里的问题呢
tinian 发表于 2020-11-8 12:25
也可以再嵌套一层if判断,或者用case when来写
我在外面加了一层if ,就像这样if(self.leftcell.value>0 ,if(self.leftcell.value<6.66*@mon,'vfs/root/products/ebi/sys/picture/红色.png',if(self.leftcell.6.66*@mon<value<7.5*@mon,'vfs/root/products/ebi/sys/picture/橙色.png',if(self.leftcell.7.5*@mon<value<8.33*@mon,'vfs/root/products/ebi/sys/picture/黄色.png',''')))),可是不对
哪里的问题呢
要满足if(条件1,结果1,if(条件2,结果2,if(条件3,结果3,结果4)))这种格式。或者case when 条件1 then 结果1 when 条件2 then 结果2 when 条件3 then 结果3 else 结果4 end 这种格式
tinian 发表于 2020-11-8 12:46
要满足if(条件1,结果1,if(条件2,结果2,if(条件3,结果3,结果4)))这种格式。或者case when 条件1 then ...
大佬,这个我按照您的方式写了,但是还是出不来。您可以帮忙看下我这个是不是哪里写的有问题,
if(self.leftcell.value<6.66*@mon,'vfs/root/products/ebi/sys/picture/红色.png',if(self.leftcell.6.66*@mon<value<7.5*@mon,'vfs/root/products/ebi/sys/picture/橙色.png',if(self.leftcell.7.5*@mon<value<8.33*@mon,'vfs/root/products/ebi/sys/picture/黄色.png')))
或者
if(self.leftcell.value>0,if(self.leftcell.value<6.66*@mon,'vfs/root/products/ebi/sys/picture/红色.png',if(self.leftcell.6.66*@mon<value<7.5*@mon,'vfs/root/products/ebi/sys/picture/橙色.png',if(self.leftcell.7.5*@mon<value<8.33*@mon,'vfs/root/products/ebi/sys/picture/黄色.png'))))
你这里面的self.leftcell.7.5*@mon<value<8.33*@mon,是啥意思?
是不是想这样写?7.5*@mon<self.leftcell.value<8.33*@mon