Right Align decimal field

Ashu_bhattAshu_bhatt Member Posts: 28
Hi All,

Can any one help me right aligning decimal field. I am exporting decimal field to a text file. By default it is left aligned ](*,)

Thanks in Advance
Ashok

Comments

  • ara3nara3n Member Posts: 9,257
    Something like this? I just wrote up this function that right aligns a decimal and returns a string.
    RightAlign(MyDecimal : Decimal;StrLength : Integer) : Text[30]
    Mytext := format(MyDecimal);
    
    for I := 1 to Strlength - strlen(Mytext) do begin
      EmptySpace := EmptySpace + ' ';
    end;
    
    exit(EmptySpace+Mytext);
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.