Talk:ISO 3166-1 numeric
Add topicAppearance
Latest comment: 6 years ago by JanGB in topic Numeric or string format?
| This article is rated List-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||
| |||||||||||||||
Numeric or string format?
[edit]This listing seems to be zero-padded, but surely that is only for presentation and not the case for the actual data format? I came across this to resolve an argument between coworkers who have implemented this as a string "because it has leading zeroes". JanGB (talk) 12:12, 7 September 2020 (UTC)
- The value is a number. It's represented in the standard (as represented by e.g. at least) with leading zeros, so this article follows suit. Your coworker may want to review printf format strings, it's the difference between
%dand%03d. Anomie⚔ 12:44, 7 September 2020 (UTC)- Quick response! Still, even reading this page does not make it very clear that the leading zeroes are safe to discard. JanGB (talk) 12:49, 7 September 2020 (UTC)