Numbers providing with a thousands/decimal separator?
Hi all,
I have wrote a little EPS-file, which generates a number, if the EPS file is placed on every page in Indesign and print out in a PostScript file. The number changes depending of the page count of the Indesign document and increases from 1 up to 15000000 - so the number may have up to 8 digits.
So far so good, the EPS works well.
The problem:
I want to mark the number with a thousands separator sign like a point, so the EPS delivers me the numbers in the following way:
from 1 to 999 without point
from 1.000 to 999.999 with a point in front of the last 3 digits
from 1.000.000 to ...... with a point in front of the last 3 digits and 6 digits and so on
I don't know how I may solve this problem. Would be glad for help.
Yosimo
%!PS-Adobe-3.1 EPSF-3.0
%%Title: (counter.eps)
%%BoundingBox: 0 0 400 60
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%Page: 1 1
/SpecialInjectData where
{
pop
/stringBuffer 10 string def
0 35 moveto
/ArialMT findfont 16 scalefont setfont
/_Number_1 { SpecialInjectData /RecipientData get (Number_1) get cvi } def % Number_1 is delivered by a database
/_PageIndex { SpecialInjectData /PageIndex get 1 add} def
/_rightAligne { dup stringwidth pop
xPosition exch sub
yPosition moveto show } def
_PageIndex stringBuffer cvs show
% left Number
/xPosition 50 def
/yPosition 5 def
/couponNo {_PageIndex 2 mul _Number_1 add 2 sub stringBuffer cvs } def % this couponNo should be setted with the thousands separator
couponNo _rightAligne
% right Number (= left Number + 1)
/xPosition 260 def
/yPosition 5 def
/couponNo {_PageIndex 2 mul _Number_1 add 1 sub stringBuffer cvs } def % this couponNo should be setted with the thousands separator
couponNo _rightAligne
}
{}ifelse
%%Trailer
%%Pages: 1
%%DocumentNeededResources: font ArialMT
%%DocumentSuppliedResources:
%%EOF
