朱莉娅1.7.2:如何使用@sprintf
我是朱莉娅1.7.2的新手。我在Julialang.org上发现了@sprintf。 我尝试将数字45显示为:00045
a = @sprintf "%05i" 45 # I get: @sprintf not defined
a = Printf.@sprintf "%05i" 45 # I get: Printf not defined
此1行程序中缺少什么?谢谢
I am new to julia 1.7.2. I found on julialang.org about @sprintf.
I try to show a number 45 as: 00045
a = @sprintf "%05i" 45 # I get: @sprintf not defined
a = Printf.@sprintf "%05i" 45 # I get: Printf not defined
What is missing in this 1 line program? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先导入
printf
模块。例如,使用使用(在这种情况下,您不需要前缀@sprintf
带有printf
):You need to import the
Printf
module first. For example withusing
(in which case you do not need to prefix@sprintf
withPrintf
):