Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

A Decimal value 88.5 in the list as right-aligned text 88:30

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I want to have in the list a decimal value of 88.5 as right aligned text (Example: 88:30).

I tried to solve this problem with c# code, but it's works only with Text-box or label and in the list is hidden :(

In other words, for me it's important that a list-field whose data type is Text was aligned to the right.

How can I solve this problem?

Thanks

Cezary

*This post is locked for comments

  • Verified answer
    Ashwini Tripathi Profile Picture
    Ashwini Tripathi 4,624 on at
    RE: A Decimal value 88.5 in the list as right-aligned text 88:30

    You can use Decimal property on Table & Page or you can use Round function on trigger OnAfterGetRecord.

    If your source field is Text use Format function.

    It will be better to stick to Nav Standards.

    Although it is possible to right allign the decimal or integer values of text field by converting the value to Variant, but other limitation and issues creaps in, to handle it again you will require to do some customizations.

    One way more you can write a function and fix the max no of characters that can be displayed in the field. Get the length of the value and add no of spaces in front similar to PADSTR which does same thing at the end of the string basically reverse functionality.  And call the function in OnAfterGetRecord.

    Or you can add the decimal variable on the page and assign the value from this field to decimal field in OnAfterGetRecord trigger. You need to Round the Value with proper precession. Provided you are not going to perform filtering, although will work but processing will be slow.

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: A Decimal value 88.5 in the list as right-aligned text 88:30

    it seems that control-addins are disabled within repeaters. so it won't work anyway.

    follow forum.mibuso.com/.../trying-to-do-a-control-add-in-in-a-list-page

    it only works in page types like card.

    as a workaround you could work with PADSTR: format the value as you like, fill the value at the beginning with as much spaces you need according the text length of the field.

    for that follow forum.mibuso.com/.../format-text-with-leading-zeros

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: A Decimal value 88.5 in the list as right-aligned text 88:30

    Thank's but for me it's important that a list-field whose data type is Text was aligned to the right.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: A Decimal value 88.5 in the list as right-aligned text 88:30

    on the page, but after converting the text (each text) is aligned to the left.

  • Rabin Profile Picture
    Rabin 2,976 on at
    RE: A Decimal value 88.5 in the list as right-aligned text 88:30

    Hey,

    Use "ROUND" function with Precision "0.001"

    ==>ROUND(1234.56789, 0.001, >) returns 1,234.568

    Ref: msdn.microsoft.com/.../dd301418.aspx

  • Suresh Kulla Profile Picture
    Suresh Kulla 44,592 on at
    RE: A Decimal value 88.5 in the list as right-aligned text 88:30

    Are you referring to the page or report ? if on page try Format Function on report you can use convert function to convert into text and format.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans