I want to set the decimal places of a given number based upon a given format. I had posted similar post earlier but this is slightly different.
Exp1:
Given Format=0,000.00
Given Number=1.2345
Expected Result=1.23
Exp2:
G Format=0,000.000%
G Number=1
Exp Result=1.000%
The decimals should not round. Like if G Format is 0,000.000
and Given Number is 1.2346, it should not Result as 1.235, but 1.234.
I want to check the number of decimal places only in a given Format string and then just set the number of decimals of the Given Number. I have tried something but it fails in some conditions. I am using VB6
Exp1:
Given Format=0,000.00
Given Number=1.2345
Expected Result=1.23
Exp2:
G Format=0,000.000%
G Number=1
Exp Result=1.000%
The decimals should not round. Like if G Format is 0,000.000
and Given Number is 1.2346, it should not Result as 1.235, but 1.234.
I want to check the number of decimal places only in a given Format string and then just set the number of decimals of the Given Number. I have tried something but it fails in some conditions. I am using VB6