I have used the UDF wrote by Bruce Vining (http://www.mcpressonline.com/programming/apis/the-api-corner-dynamically-editing-a-numeric-value.html)
Now in my code use:
Select cast (EDITC(field, n, p, 'X') as CHAR(n+2)) from MyTable
n = length of number
p = precision
N+2 = length of the char that i want (2 = 1 byte for the sign and 1 byte for the point/comma)
Now I'd like to return the exact result without using the cast function, there is a smart way for doing this?