Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data Type Conversion

Former Member
0 Likes
591

I have a string as follows:

0000060880000

I need to assign it to a field in a database record with

the following type CURR Length 11 Decimals 2

When I move it into this field it is recorded as

60,880,000.00

It should be recorded as 60.88

How would I do that?

1 ACCEPTED SOLUTION
Read only

prasenjit_sharma
Active Contributor
0 Likes
567

Hi,

I did not understand why you want to store 0000060880000 as 60.88. What is your logic? Would you always divide the no by

1000000 or this is a constant no?

Well, if 0000060880000 is character type then you might have to move it to a numeric variable first then divide and then write to CURR and I suppose you'd need a UOM for the currency. Do you have that logic ready?

Regards

Prasenjit

3 REPLIES 3
Read only

Former Member
0 Likes
567

The only way would be to divide the number with 1000000

field = 0000060880000 / 1000000.

Read only

former_member156446
Active Contributor
0 Likes
567

divide by 1000000

Read only

prasenjit_sharma
Active Contributor
0 Likes
568

Hi,

I did not understand why you want to store 0000060880000 as 60.88. What is your logic? Would you always divide the no by

1000000 or this is a constant no?

Well, if 0000060880000 is character type then you might have to move it to a numeric variable first then divide and then write to CURR and I suppose you'd need a UOM for the currency. Do you have that logic ready?

Regards

Prasenjit