I’m looking for a way to turn user input into normalized data fit for calculation. The input is some length of time, and is coming from Twitter, so it’s string only. Ideally I’d love these results:
an hour and a half –> 01:30
27.52 –> 00:28
5:24 –> 05:24
Is this is a particularly difficult thing to do? I could focus on coaching the users on how to create good input, but also don’t want to be too strict.
Any suggestions would be great,
Thanks!
Three things to make it work:
Since it’s user input and non-deterministic that’s the only way. Even then the results won’t be 100% reliable and a small margin of error should be acceptable.