Format Musk

navuser1
Member Posts: 1,334
Is there any property in Navision to Print a decimal Amount in
such format
If amount is 1000.000 than it print 1000.xxx
If amount is 1000.900 than it print 1000.9xx
If amount is 1000.009 than it print 1000.009
such format
If amount is 1000.000 than it print 1000.xxx
If amount is 1000.900 than it print 1000.9xx
If amount is 1000.009 than it print 1000.009
Now or Never
0
Comments
-
have u used property named "Decimal Places" of text box
try it.......Experience Makes Man Perfect....
Rajesh Patel0 -
I hv used Decimal Places but it does not replace 0s by X.Now or Never0
-
Hey 'navuser1',
I have a solution to your problem (although it is pretty rough).//StartNum [Decimal] assigned to Text001 textbox //Conversion [Text] assigned to Text002 textbox Mask := '%1'; //Local Variable [Text] MiddleMan := STRSUBSTNO(Mask,StartNum); //Convert from Decimal to String and store in local var MiddleMan [Text] Conversion := ''; //Can use a local variable to store the makings but I just assigned to global variable FOR Counter := 1 TO STRLEN(MiddleMan) DO BEGIN IF (MiddleMan[Counter] = '0') AND (FoundIt) THEN BEGIN Conversion := Conversion + 'X'; END ELSE BEGIN Conversion := Conversion + STRSUBSTNO(Mask,MiddleMan[Counter]); END; IF MiddleMan[Counter] = '.' THEN FoundIT := TRUE; //Mark when we find the decimal point END;
0 -
Ah scratch that... that'll replace all 0's after the decimal point to 'X's.
Well you can just adjust the code I have provided to come up with the solution you desire.0 -
Ok ok ok, here is a much more refined code to do exactly what you want...
MiddleMan := STRSUBSTNO('%1',StartNum); Counter := STRPOS(MiddleMan,'.'); Counter := 3 - (STRLEN(MiddleMan) - Counter); //3 is the # of places past the decimal point. FOR intCount := 1 TO Counter DO MiddleMan := MiddleMan + 'X'; Conversion := MiddleMan;
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions