there is a function to extract only decimal numbers

gorvega79gorvega79 Member Posts: 73
edited 2009-07-17 in Navision Financials
Hi
i want to extract from an amount only the numbers after decimal point, there´s a function or i have to do a little program to do this. thanks

Answers

  • garakgarak Member Posts: 3,263
    you doesn't need a programm ;-)

    Here two, not tested, solutions
    Name DataType Subtype Length
    X Decimal
    Y Text 2
    I Decimal
    Z INTEGER

    X := 2368.12; //the dot (.) could also be a comma (,). It's depend. on your local language settings
    Y := copystr(format(x),Strpos(format(x),'.')+1,2); //12

    I := x mod 1; //0.12
    Z := x mod 1 * 100; //12

    Regards
    Do you make it right, it works too!
  • gorvega79gorvega79 Member Posts: 73
    it work perfectly, thanks so much rené
  • garakgarak Member Posts: 3,263
    no problem and welcome
    Do you make it right, it works too!
Sign In or Register to comment.