繁体   English   中英

将数组内的INT更改为带有2个小数点python的格式[关闭]

[英]Changing INT within array to format with 2 decimal points python [closed]

        print(f'[{datetime.now()}] => Current Price: {format(price,'.2f')} ID: {id} Item: {item}')

我目前在数组中有 Int,我想在 0 之前添加小数点以将其转换为浮点数。 前任。 12900 => 129.00 , 9700 => 97.00但是当我运行我的代码时出现错误SyntaxError: f-string: unmatched '('

暂无
暂无

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

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