odf.Formatting has a private method called "lengthInCm" that tries to do something like this. I'd really like to see this unit conversion code live in a common place so we can start leveraging it in WebODF to improve layout.