I spend three days trying to solve this last week and was unsuccessful. I currently have a Windows Form text box in which the user types the numbers 123456789. I want to move that data into a numeric field with the value of: 1234567.89 where the last two numbers are to be placed to the right of the decimal point. What I have is the following:
01 TOTAL-BALANCE 9(7)V99.
method-id txt-TOTAL-BALANCE_Text_Changed final private.
procedure division using by value sender as object e as type System.EventArgs.
set TOTAL-BALANCE to binary-double unsigned::Parse(txt-TOTAL-BALANCE::Text)
The above command, however, gives me a TOTAL-BALANCE with a value of 123456789.00. I have tried a couple of ways of getting the last two digits in the decimal places but I cannot seem to be successful. I was reading a similar thread located at :https://community.microfocus.com/t5/Visual-COBOL-Forum/Formatting-numeric-data-items/m-p/1731883.
I tried some of the suggestion in this thread but could not get my code to compile. What I basically want to do is to convert a string to a numeric decimal. Is there an easier way to do this?