How to Split the Decimal Value into integer and decimal part
gulamdastagir
Member Posts: 411
Hello
In the navision Standard report #2 there is a field called Amount and suppose its showing "99.50" Dollars.
Is there a way we can split this into two text boxes one displaying 99 Dollars and the Other 50 Cents
Thanks,
gd
In the navision Standard report #2 there is a field called Amount and suppose its showing "99.50" Dollars.
Is there a way we can split this into two text boxes one displaying 99 Dollars and the Other 50 Cents
Thanks,
gd
Regards,
GD
GD
0
Comments
-
You can place 2 textboxes on your report (or actually an additional 1 because there is 1 there already)
Make sure they both have the same Source Expression. In the Format property for the 1 you want to display integers type <Integer> in the other textbox's Format property type <Decimals>
That's it.This isn't a signature, I type this at the bottom of every message0 -
And in case you want it in variables:
integer part := decDecimal DIV 1; decimal part := decDecimal MOD 1;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Try this
MESSAGE('%1',99.50 DIV 1); //= 99
MESSAGE('%1',99.50 MOD 1 * 100); // = 50
So the source for the textboxes with decimal places set to 0
AMOUNT DIV 1
AMOUNT MOD 1 * 100Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
SteveO Posted: Thu Aug 24, 2006 2:43 am Post subject:
You can place 2 textboxes on your report (or actually an additional 1 because there is 1 there already)
Make sure they both have the same Source Expression. In the Format property for the 1 you want to display integers type <Integer> in the other textbox's Format property type <Decimals>
That's it.
Iam sorry it doesnt work,i already tried that before i made a postRegards,
GD0 -
gulamdastagir wrote:SteveO Posted: Thu Aug 24, 2006 2:43 am Post subject:
You can place 2 textboxes on your report (or actually an additional 1 because there is 1 there already)
Make sure they both have the same Source Expression. In the Format property for the 1 you want to display integers type <Integer> in the other textbox's Format property type <Decimals>
That's it.
Iam sorry it doesnt work,i already tried that before i made a post
In the source for the textbox try FORMAT(Amount,0,'<Integer>') and FORMAT(Amount,0,'<Decimal>')
But that gives 0.50 so FORMAT(Amount,0,'<Decimal>') * 100Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
THIS WORKS THANKS KRIKI AND DAVID
David Cox Posted: Thu Aug 24, 2006 2:59 am Post subject:
Try this
MESSAGE('%1',99.50 DIV 1); //= 99
MESSAGE('%1',99.50 MOD 1 * 100); // = 50
So the source for the textboxes with decimal places set to 0
AMOUNT DIV 1
AMOUNT MOD 1 * 100
kriki Posted: Thu Aug 24, 2006 2:50 am Post subject:
And in case you want it in variables:
Code:
integer part := decDecimal DIV 1;
decimal part := decDecimal MOD 1;Regards,
GD0 -
Hi gulamdastagir,
I'm curious to find out why you said using the Format property does not work? As I have tested it and it does work, admittedly it does produce .50 as opposed to just 50 (unless this is what you where refering to?).
Just in caseFORMAT(Amount,0,'<Decimal>') * 100
wont work because the FORMAT will have converted the expression to a string and string * 100 does not compute.This isn't a signature, I type this at the bottom of every message0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions