xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steffanina, Jeff" <Jeff.Steffan...@marriott.com>
Subject RE: Placing the minus sign(-) to the RIGHT side of the number
Date Thu, 02 Sep 2010 12:20:00 GMT
Given the nature of my data, I took this approach and everything works
fine.
 
Thanks.
 

Jeff


________________________________

	From: Eric Douglas [mailto:edouglas@blockhouse.com] 
	Sent: Wednesday, September 01, 2010 10:21 AM
	To: fop-users@xmlgraphics.apache.org
	Subject: RE: Placing the minus sign(-) to the RIGHT side of the
number
	
	
	This seems relatively simple.
	I assume the problem is that your data has 233.94- and
format-number requires -223.94.
	I don't know the syntax offhand but there is a method in the xsl
to check the last character of the data field.
	You could just use the value of (if {last character} = "-") for
an xsl:choose condition to parse the inv-amt input field, to move the
"-" to the front with a concat() function then pass the result into the
format-number.
	 
	(of course it's even easier the way I did it, where the program
generating the XML data already formats numbers into text and calculates
absolute positioning to print them)

________________________________

	Sent: Wednesday, September 01, 2010 10:03 AM
	To: fop-users@xmlgraphics.apache.org
	Subject: Placing the minus sign(-) to the RIGHT side of the
number
	
	
	I am using FOP to produce an invoice in a .PDF.   Everything
works.
	However, when a negative number is produced in my right
justified table column, the minus sign causes the decimal point to be
mis-aligned.
	I found the "format-number" function and this addresses the
problem.  Now the issue is that my system generates a negative value in
the form of:
	     233.94-
	(the minus sign is always to the right of the value)  This
cannot be changed.   When I submit the value to "format-number", it
returns a "NaN" error.
	 
	select="format-number(inv-amt,'##,###.00;#####.00-')"
	 
	In summary, I need to produce a column of numbers, right
justified, some of the values are negative with the minus sign to the
right.  At the same time, the vertical alignment of the decimal point is
required.  
	 
	Any ideas?
	 
	Thanks.
	 
	Jeff
	 


Mime
View raw message