Mail Archives: geda-user/2012/07/12/00:25:09
On Thu, Jul 12, 2012 at 12:13:52AM +0100, Ed Simmons wrote:
>
> Sorry for the noise, I've figured it out. Dividing from the base
> unit and printing an integer works fine for my purposes.
>
> pcb_fprintf(fp, "3 : 230: 1: 3: 0:F 1X %iY %iA %iR %s %s %s\n",
> x/10000 , y/10000 , theta * 10, name, value, FRONT
> (element) == 1 ? "top" : "bot");
>
Please don't use base units -- %i won't work on 64-bit systems, and
isn't guaranteed to work on any systems in the future. Instead use
the %mn specifier to output coordinates as nanometers. (Then you can
use /10000 as you have.)
> Thanks for your help, now I also realise there was no problem with
> mixed units, I was rolling over variables and other wonderful
> things.
>
--
Andrew Poelstra
Email: asp11 at sfu.ca OR apoelstra at wpsoftware.net
Web: http://www.wpsoftware.net/andrew
"You shouldn't trust every quote you read on the Internet." -- Socrates
- Raw text -