Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Convert centimeter to twips and twips to centimeter


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Oct 17, 2016 4:14 PM Last Post By: Remy Lebeau (Te...
Michael Eriksen

Posts: 27
Registered: 6/12/11
Convert centimeter to twips and twips to centimeter  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2016 5:17 AM
Hello all,
Is there someone who can help me with 2 small codesnippet to convert from centimeter to twips and twips to centimeter?
I have searched and googlet without any luck :-(

Thanks in advance,
Michael
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Convert centimeter to twips and twips to centimeter  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 17, 2016 4:14 PM   in response to: Michael Eriksen in response to: Michael Eriksen
Michael wrote:

I have searched and googlet without any luck :-(

Based on this:

http://www.translatorscafe.com/cafe/EN/units-converter/typography/1-3/twip-centimeter/

1 twip = 0.001763888888889 centimeter

Try this code:

const
  TwipsInACm = 0.001763888888889;
 
function TwipsToCm(Value: Double): Double;
begin
  Result := Value * TwipsInACm;
end;
 
function CmToTwips(Value: Double): Double;
begin
  Result := Value * (1.0 / TwipsInACm);
end;


--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02