3 ms·
This. Just because something contains numbers doesn't mean that it's numeric. Times aren't numbers because 6pm * 7am doesn't yield a meaningful result. Same th
by Alex3917 6y ago
This. Just because something contains numbers doesn't mean that it's numeric. Times aren't numbers because 6pm * 7am doesn't yield a meaningful result.
Same thing with serial numbers, VIN numbers, building floor numbers, phone numbers, etc. All of those should always be strings, because performing "math" on them wouldn't yield meaningful results.
- MaxDPS 6y agoI work in ecommerce and deal with this issue a TON. I see it in things like GTIN/UPC or tracking numbers.
- chrisandchris 6y agoWhile I basically agree, there‘s a difference between „always send numbers as string“ and „send something that looks like a number but is actually a string as a string“. Why should i send a dimension as a string? How am I going to calculate the volume from 3 strings?
- Alex3917 6y ago> Why should i send a dimension as a string? You shouldn't because a dimension is a number. Something 4 feet long is twice as long as something 2 feet long.