At 01/07/16 13:11 +0200, Sülter, Uwe wrote:
>I'm trying to convert a number into a string.
Really? It looks like you are converting a string into a number.
>My problem is that the number looks simular to this: 2,9987 but I think I
>need it like 2.9987 so I tried to fix this with the function
>translate('2,9987',',','.') but this gives me a translator exception saying:
>Message is : Expected ,, but found:
>pattern = 'number(translate(('2,9987','\,','.'))Remaining tokens: ( ')')
>Does anybody has an idea why this doesn't work?
From the message, it looks like you have two left parentheses in the
expression after "translate" where only one is required.
Hence, the message "remaining tokens ')'" might be saying "you've got three
left parentheses and only two right ones so I'm missing a remaining token
of a right one".
I'm not sure where the backslash is coming from, but if it is in your
expression, then the translate function will translate "\" into "." and
will remove "," changing your string to "29987" which will produce a much
larger number than 3.
I hope this helps.
G. Ken Holman mailto:[log in to unmask]
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/l/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML/OmniMark services, training, products.
Book: Practical Transformation Using XSLT and XPath ISBN 1-894049-06-3
Article: What is XSLT? http://www.xml.com/pub/2000/08/holman/index.html
Next public instructor-led training: 2001-08-12,08-13,09-19,10-01,
Training Blitz: 3-days XSLT/XPath, 2-days XSLFO in Ottawa 2001-10-01/05