[AccessD] Converting Imperial measures
Gustav Brock
gustav at cactus.dk
Fri Feb 16 09:37:51 CST 2018
Hi all
One more Replace is needed to accept strings with a dash like 8' 5-7/16":
DecimalFeet =
Eval(Replace(Replace(Replace(Replace(m, """", ""), "'", "*12 "), " ", "+"), "-", "+")) / 12
When DO the US enter modern time and switch to decimals?
/gustav
-----Oprindelig meddelelse-----
Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] På vegne af Gustav Brock
Sendt: 16. februar 2018 15:59
Til: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Emne: [AccessD] Converting Imperial measures
Hi all
Good examples for usage of Eval are rare, but here is one - a one-liner for converting Imperial feet-inch measures (string) to decimal feet (double):
DecimalFeet = Eval(Replace(Replace(Replace([Measurement], """", ""), "'", "*12 "), " ", "+")) / 12
It will accept expressions like:
6'
7"
7 3/4"
6'7"
6' 7"
6' 5 3/16"
/gustav
More information about the AccessD
mailing list