Skip to content
Advertisement

Function to convert units based on conversion table

There is a very simple table in the database with metric unit conversions, that looks like:

I was thinking about creating a function to convert units that calculates the conversion from the table based on inputs (Unit, FromUnit, ToUnit).
For example Conv_Units(0.1, 'm', 'cm') returns 100.

Is this even possible? What I came up with is following, but it does not work:

Advertisement

Answer

Thanks @GSerg for the solution.

That was it:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement