在 GREL 或 Python 中替换并乘以一个值
我试图在 GREL 或 Python 中执行以下操作,如果字符串包含 "$" ,我将替换它,并将其替换为值 * 0.77 ,如果字符串不包含,则值保持不变。 我执行了以下操作 if(value.contains("$"),value.replace("$",""), value)
所以我能够删除 $.如何将 1 美元的值乘以 0.77?
谢谢
I am trying to do the following operation in either GREL or Python where I replace a string if it contains "$" and replace it with a value * 0.77 , if the string does not contain, then the value remains same.
I did the following if(value.contains("$"),value.replace("$",""), value)
so i was able to remove $. How do I multiply those values which had a dollar with 0.77?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有效
this worked