Hello,
I am trying to use DecimalToString finction because the source columns field is decimal and it is mapped to target field which is always char.
Incoming data is like 0000002.22 is what the file has now...10 bytes with a decimal. I want to take the decimal out an the final should be zero pad to the left.
it should be "000000999" ... 9 bytes and no decimal in target.
Tried left("000000000" : DecimalToString(ColName,"suppress_zero") ,9) - didnt work as I am getting the scale of 2 still
Any help?
Thanks in advance!!
DecimalToString zero pad to the left
Moderators: chulett, rschirm, roy
DecimalToString zero pad to the left
Suriv
No one is perfect... that's why pencils have erasers
No one is perfect... that's why pencils have erasers
You can do this in at least a few ways:
- Multiply by 100 and convert to integer, then put into a string with left zero padding.
- Store the string with decimal point in a stage variable and use left() and right() to grab all but the decimal point
- Use the Convert() function to replace the "." with "" (empty string) in the string
All three will work, but the last is probably the simplest
Regards,
- Multiply by 100 and convert to integer, then put into a string with left zero padding.
- Store the string with decimal point in a stage variable and use left() and right() to grab all but the decimal point
- Use the Convert() function to replace the "." with "" (empty string) in the string
All three will work, but the last is probably the simplest
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.