Formatting numerical values for Web

This tip describes formatting numerical values for Web.

View member feedback to this tip.

Here is a method for formatting numerical values in view columns on Web. The following method formats for maximum of 12 digits as 999,999,999,999 and you can change it as per your requirement.


amt:=@Text(999999999999);
length1:=@Length(amt);
amt1:=@If(length1=1;"";length1 
< 4; amt; length1< 5; 
@Middle(amt;0;1)+","+@Middle(amt;1;3);
length1< 6; @Middle(amt;0;2)+","+
@Middle(amt;2;3);length1< 7; 
@Middle(amt;0;3)+","+@Middle(amt;3;3);
length1< 8; @Middle(amt;0;1)+","+
@Middle(amt;1;3)+","+@Middle(amt;4;3);
length1< 9; @Middle(amt;0;2)+","+
@Middle(amt;2;3)+","+@Middle(amt;5;3);
length1< 10; @Middle(amt;0;3)+","+
@Middle(amt;3;3)+","+@Middle(amt;6;3);
length1< 11; @Middle(amt;0;1)+","+
@Middle(amt;1;3)+","+@Middle(amt;4;3)
+","+@Middle(amt;7;3);length1< 12; 
@Middle(amt;0;2)+","+@Middle(amt;2;3)
+","+@Middle(amt;5;3)+","+@Middle(amt;8;3);
length1< 13; @Middle(amt;0;3)+","+
@Middle(amt;3;3)+","+@Middle(amt;6;3)
+","+@Middle(amt;9;3);amt);
amt
 

MEMBER FEEDBACK TO THIS TIP

A far more flexible and effecient way of achieving the same result is: @Text(NumericField; ",")

-- Roger A.


Do you have comments of your own? Let us know.

This was first published in May 2003

Dig deeper on Lotus Notes Domino Formula Language

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close