How to format decimal..?

voodoo
Member Posts: 82
I have a decimal number(field in report) and I tried to use DecimalPlaces property of the field 0:0, because I need numbers before decimal separator:
example:
I have: 26,154.97 and I need: 26,154
and 0:0 doesn't do that.......after that I tried with ROUND:
SalesAmount[j] := ROUND(SalesAmount2[k],1,'>');
and with this I got 26,155.00
I know that i can cast it into integer, but is it possible to do with decimal?
Thanx
example:
I have: 26,154.97 and I need: 26,154
and 0:0 doesn't do that.......after that I tried with ROUND:
SalesAmount[j] := ROUND(SalesAmount2[k],1,'>');
and with this I got 26,155.00
I know that i can cast it into integer, but is it possible to do with decimal?
Thanx
misha fka voodoo
0
Comments
-
Hi,
try it with:
SalesAmount[j] := SalesAmount2[k] DIV 1;
br
Josef Metzbr
Josef Metz0 -
Or
FORMAT(Amount,0,'<Sign><Integer Thousand>');
But this leaves you with a text, not a decimal :?0 -
Well... I tried with DIV but still have 26,154.00
Solution with format is ok, but after that I must cast it into decimal because must do some calculationsmisha fka voodoo0 -
Why do you want to leave the .00 with calculations??? When the calculations are done the user does not see the value?
Leaving the .00 is only usefull when presenting the value :?
Or am I missing the point here :?:0 -
-
Mark Brummel wrote:Why do you want to leave the .00 with calculations??? When the calculations are done the user does not see the value?
Leaving the .00 is only usefull when presenting the value :?
Or am I missing the point here :?:
I think that you didn't understand me, because I don't want to see anything after the decimal separator... that .00 i don't want to seemisha fka voodoo0 -
voodoo wrote:Well... I tried with DIV but still have 26,154.00
As far as I know there is no difference in calculating with 26,154.00 and 26,154
In the database they are decimal values, the .00 is not stored in the database but only appears on presentation.
The database contains 26154 (Or some weird BCD value)0 -
voodoo wrote:Mark Brummel wrote:Why do you want to leave the .00 with calculations??? When the calculations are done the user does not see the value?
Leaving the .00 is only usefull when presenting the value :?
Or am I missing the point here :?:
I think that you didn't understand me, because I don't want to see anything after the decimal separator... that .00 i don't want to see
try to change the Property "DecimalPlaces" to 0:0 in the output control.
br
Josef Metzbr
Josef Metz0 -
voodoo wrote:Solution with format is ok, but after that I must cast it into decimal because must do some calculations
??? You need to do that only on output - and on output you do not do calculations...
If you need do the calculations, you need to use ROund or DIV 1, after that, when you are presenting the value to the user, you need to use FORMAT or DecimalPlaces...0 -
Ok, thank you allmisha fka voodoo0
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