Skip to main content

Posts

Showing posts with the label decimal

How to separate Fraction and Digit from Number in axapta

To separate Fraction and Digit from Number in axapta like number is 878778.3000 and you want to get 878778 and .300 then below code can help you to get the same. qty t=878778.3000; str _amount = strFmt("%1",num2str(t,0,1,0,0)); boolean decimals; TextBuffer txtAmount = new TextBuffer(); txtAmount.setText(_amount); if (txtAmount.find("^[0-9]+$")) // Regular expression inside the find method { decimals = true; } info(strFmt("%1 -- %2",trunc(t),frac(t)));

The number to convert to a text string using MSD axapta x++

num2Str info("num2Str(real number,int character,int decimals,int separator1,int separator2)"); info("number - The number to convert to a text string."); info("character - The minimum number of characters required in the text."); info("decimals - The required number of decimals."); info("separator1 - The decimal separator. Possible values: 1 – point (.) and 2 – comma (,)"); info("separator2 - The thousands separator. Possible values: 0 – no thousands separator ,1 – point (.) ,2 – comma (,) ,3 – space ( )"); info("num2Str(12345.6,1,2,1,2) " + num2Str(12345.6,1,2,1,2));