Hi All,
Is there a way/Function to change the format of the amount. E.g., Input value is 123456.78 and output should be $123,456.78
Whatever I'm asking is the equivalent of the below server function in parallel:
Server Fn: Oconv(Arg1,"$MD,2")
Currency Format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
Currency Format
Arun
I don't think there is an equivalent for Oconv function
You can try this awk or you can write your own C++ function
You can try this awk or you can write your own C++ function
Code: Select all
$ echo 1123456.78 | awk -F'.' ' { y=$1;while ($1/1000 != 0) { x=int($1 /1000); sub("^"x,"&,",y); $1=x } print "$"y"."$2 } '
$1,123,456.78
$ echo 123456.78 | awk -F'.' ' { y=$1;while ($1/1000 != 0) { x=int($1 /1000); sub("^"x,"&,",y); $1=x } print "$"y"."$2 } '
$123,456.78
You are the creator of your destiny - Swami Vivekananda
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
Thanks Anbu.
One more question before I go for one of your suggestions.
BASIC_TRANSFOMER accepts the oconv function in a parallel job. But when I run the job it doesnt provide any proper output for this command. Is there comething we need to do to make it work or It will never work in a parallel job?
If none of the server function will work in a parallel job via Basic_transformer, what is the use of having it?
One more question before I go for one of your suggestions.
BASIC_TRANSFOMER accepts the oconv function in a parallel job. But when I run the job it doesnt provide any proper output for this command. Is there comething we need to do to make it work or It will never work in a parallel job?
If none of the server function will work in a parallel job via Basic_transformer, what is the use of having it?
Arun
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
I'm using the function in one of the server job which is working fine. I just copied the same into a parallel job and hard coded the value but that doesnt work
And thanks for your quick replies Anbu, I really appreciate it! I will mark this topic as resolved as all I wanted to know was, whether there is a equivalent function in parallel or not.
And thanks for your quick replies Anbu, I really appreciate it! I will mark this topic as resolved as all I wanted to know was, whether there is a equivalent function in parallel or not.
Arun