4 ms·
We have to do that in our database for numbers since zeros get truncated off the left side if it is detected as a number--and the number of zeros is important.
by cordite 12y ago
We have to do that in our database for numbers since zeros get truncated off the left side if it is detected as a number--and the number of zeros is important.
I don't know about people doing stuff in file systems these days like that, but it is a simple hack.
- naturalethic 12y agoUh what. Do you use Excel as your database?
- cnvogel 12y agoI think /cordite/ tried to make a sarcastic joke. Or did he...?
- cafard 12y agoThe ways of Microsoft controls can be interesting indeed. At one point, we had to reverse-sort phone numbers to be loaded into a VARCHAR column in SQL Server. The vendor used a Microsoft control, which would look at a couple of phone numbers, say 2025551212, conclude that they were suitable for 32-bit integers, and choke somewhere around the 404 area code. Then there was the time another package tried to write out street addresses that were something like 3E123 or maybe it was E456. Apparently the control read them as numbers in scientific format that were just way too big.
- cordite 12y agoSince traversing forward is always cheaper than backwards, we subtract our reverse numbers by a magic number for things we want to access in reverse order. Or in this case, dates where the most recent is first.
- cordite 12y agoI am not making a joke. This stuff is from the 70-80s. Everything is a string unless it is numeric.