View previous topic :: View next topic
|
Author |
Message |
d_sarlie
New User
Joined: 22 Apr 2008 Posts: 42 Location: coimbatore
|
|
|
|
HI,
I want to convert a value to either Million or Billion.
for eg
The value 4M has to get converted to 4000000
The value 7B has to get converted to 7000000000
Is there are any cobol inbuilt functions which converts this.
Can you please let me know the Possible ways to get this done.
Thanks
Jeba. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
There is a list of functions in the manual. When you don't find it there, have a think why that might be.
What are the maximum and minimum values you might receive? Give further examples, which cover all situations, including no M or B if that is possible. |
|
Back to top |
|
|
d_sarlie
New User
Joined: 22 Apr 2008 Posts: 42 Location: coimbatore
|
|
|
|
Bill Woodger wrote: |
What are the maximum and minimum values you might receive? Give further examples, which cover all situations, including no M or B if that is possible. |
At Font end clients are feeding values like a number and then M or a number then the B.For this I need a conversion logic to display the Zeroes. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
this I need a conversion logic to display the Zeroes. |
no builtin function will provide that,
given moreover that a standard does not exist the multiplier suffixes
use reference count to separate the digits from the suffix and apply the proper multiplier |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
enrico-sorichetti wrote: |
no builtin function will provide that,
given moreover that a standard does not exist the multiplier suffixes
use reference count to separate the digits from the suffix and apply the proper multiplier |
Indeed. I have worked in places where 4M means 4 thousand (because M is the Roman numeral 1,000) and 4MM means 4 million. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
999,910
1,391M
1.391B
2,476B
3,000B
3Y |
Got any like those?
What type of output do you want? A "string" number or a "usual" one (packed/zoned)?
How good is the "front end" verification? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
don.leahy wrote: |
enrico-sorichetti wrote: |
no builtin function will provide that,
given moreover that a standard does not exist the multiplier suffixes
use reference count to separate the digits from the suffix and apply the proper multiplier |
Indeed. I have worked in places where 4M means 4 thousand (because M is the Roman numeral 1,000) and 4MM means 4 million. |
Note also that to an American "four billion" means 4x10^9, whereas to a European "four billion" means 4x10^12. |
|
Back to top |
|
|
|