Post Reply 
Temperature conversion problem. Please help!
08-10-2017, 07:27 AM (This post was last modified: 08-10-2017 07:31 AM by StephenG1CMZ.)
Post: #2
RE: Temperature conversion problem. Please help!
If I recall correctly, there are two techniques that can be used to strip out units.

Mathematically, if one divides 3_m by 1_m the result is 3 - a dimensionless number without any units. However, in the case of temperatures I am not certain that would work without first converting to Kelvin, because of the differing 0's.

Alternatively, str(x) will yield a string like "3_m" and one can then strip out the underscore and unit from the string, leaving just "3".

I have implemented temperature and other unit conversions In my Z_UNITS program.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Temperature conversion problem. Please help! - StephenG1CMZ - 08-10-2017 07:27 AM



User(s) browsing this thread: 1 Guest(s)