整数到带前导零的字符串
integer to string with leading zeros
下午好,
我是 post 脚本的新手,正在研究 XMPie 应用程序的编码图形元素以实现 post 合成集成。
我无法解决的问题是将整数转换为 3 位填充字符串。
IE 1 -> “001”,20 -> “020”,400 -> “400”
非常感谢任何朝着正确方向的推动。
/padthree
{
1000 add 7 string cvs 1 3 getinterval
} def
1 padthree
例如:
/padthree
{
1000 add 7 string cvs 1 3 getinterval
} def
1 padthree
5 padthree
40 padthree
stack
产出
040
005
001
PS<SSS>
下午好,
我是 post 脚本的新手,正在研究 XMPie 应用程序的编码图形元素以实现 post 合成集成。
我无法解决的问题是将整数转换为 3 位填充字符串。
IE 1 -> “001”,20 -> “020”,400 -> “400”
非常感谢任何朝着正确方向的推动。
/padthree
{
1000 add 7 string cvs 1 3 getinterval
} def
1 padthree
例如:
/padthree
{
1000 add 7 string cvs 1 3 getinterval
} def
1 padthree
5 padthree
40 padthree
stack
产出
040
005
001
PS<SSS>