Mail Archives: geda-user/2012/07/11/19:14:09
On 11/07/12 23:24, Ed Simmons wrote:
>> Surprising. But I suspect that you want a lowercase m in the format
>> to force mm output. Uppercase M tries to select automatically an
>> uIt works by passing the unit through the %m+ mechanism, which limits
>> the choice of units of the following %.2mS (the bom exporter has
>> options to chose the units).
>>
>> But if all you want is mm with 2 fractional digits, use %.2mm.
>>
>> Gabriel
> Sorry - badly worded explanation on my part - I'm trying to output,
> for example 12mm as 1200, with no decimal places at all in the
> resulting output. However, just multiplying the X and Y data
> calculated as per the BOM code yields what looks like roll over of
> values, with some values being printed in negative. It seems like I
> should be adding a mode/extra units option to the pcb_printf, does
> this sound right?
>
> Thanks,
> Ed
>
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");
Thanks for your help, now I also realise there was no problem with mixed
units, I was rolling over variables and other wonderful things.
Ed
- Raw text -