Hi
I have a Sybase source with Column A as Float. I want to Truncate the value of decimals to 8 places and round it and if there is a zero after decimal place, that should be padded with 8 zeroes.
My job design is
Sybase Src (Float) ---> Transfrmer ----> Sequential file (Float)
I didn't find a function to do this in Transformer.
Please suggest how can I do this.
Thanks
Suresh
Truncate and Round Float type data
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 81
- Joined: Mon Nov 21, 2005 4:17 am
- Location: Sydney, Australia
- Contact:
Truncate and Round Float type data
SURESH NARASIMHA
-
- Premium Member
- Posts: 81
- Joined: Mon Nov 21, 2005 4:17 am
- Location: Sydney, Australia
- Contact:
Float data type trunc and round
Hi Chulett
Here is some sample data input and desirable output
Thanks
Here is some sample data input and desirable output
Code: Select all
Input Output (8 decimals)
===== ==========
0 0.00000000 - Padded with zeroes
1.22334222765 1.22334223 - Truncate and Round
1.23244 1.23244000 - Truncate and Round
Thanks
SURESH NARASIMHA
Thanks for that. Added some
Code: Select all
tags so the example was readable.
Just want to point out that your target field will need to be a [i]string,[/i] not another float, if you want to control the formatting like that.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers