Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为仓库建模。每个单元格都以如下格式分配给一个 id。
外部数据的标准格式是四位数。但是,有些 id 只有 3 个,例如“A05”。有没有一种简单的方法可以自动添加一个“0”使其像“A005”?
也许这个记者会为你工作 - 它应该在第二个位置添加一个零,直到字符串长度为 4 或更大。
to setup ca print map add-zero [ "A" "A1" "A01" "A001" "A123" ] reset-ticks end to-report add-zero [ string ] if length string >= 4 [ report string ] report add-zero insert-item 1 string "0" end