15,904,655 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Anant Beriwal (Top 9 by date)
Anant Beriwal
7-Jan-16 3:10am
View
purging
Anant Beriwal
7-Jan-16 2:51am
View
Asif, here I have updations too on existing row, in any case , job is deleting old items from database. but job cant run every minute(It will be a very operation), so it is schedule for half hour. now the only problem is this half hour time stamp which can be left out of calculation via calculating records of last 24 hours. Can delete and then simply count will not be a good idea?
Anant Beriwal
7-Jan-16 1:58am
View
error: function(Error) { alert(Error.responseText) }
use syntax like this, it may give a better insight of error
Anant Beriwal
7-Jan-16 1:50am
View
debug a little, press f12 on browser then see any error message is there or not. in most cases, there is a specific error present there.
Anant Beriwal
5-Jan-16 12:33pm
View
simple, it is a database field having length of decimal (18,5) (means 5 digits after decimal). so code picks it up at it is. problem is simple. when the transaction was done and now when the reports are generated, there is a difference of some dollars( there are more than 1000 transactions). I hit and try some other ways and find out that the way of calculation is the problem. The same issue lie with 3 decimal places too. See the code
static void Main(string[] args)
{
decimal ab = new decimal();
ab = (decimal)4.445;
decimal Round1 = Math.Round(ab,2);
decimal c = ab / 3;
decimal d = c * 3;
decimal Round2=Math.Round(d,2);
}
I have already closed the issue at my end. I changed the way how calculations will be done at time of actual transaction. (I removed the division part from equation). I am just curious how much bigger blunder this kind of thing can cause. Sorry but I am fond of full proof solutions :)
Anant Beriwal
5-Jan-16 5:29am
View
The actual problem is related to currency. We have a system which have data from one currency to another. the values are against 1 dollar. now each value more than 5 point decimal. Now when I sell a item, the user may pay in different currency. I convert it to USD (up to 5 points decimal) and save it at my database, also I will save rate of conversion for that day. Now when user asks for report at end of month/year, it will be in his own currency. now there this calculation gave errornous data. This is just a small version of that.
My database stores only upto 5 decimals. I cannot change design now
Anant Beriwal
1-Jun-15 2:21am
View
this may work, as long as my use case is concerned. Going by a more generalize way, I was thinking will the rounding up cause issue in greater significance. specially in cases where money is involved.
Anant Beriwal
31-May-15 23:57pm
View
so any solution?? I need to round up. Can I provide some algo or hypothesis to it.
Anant Beriwal
31-May-15 23:56pm
View
Sir,
The problem is, I have to round of. This is a real time scenario, the database will not hold anything beyond 5 decimal points. truncating the decimal set will cause even more difference with actual answer. I want to know, Can we do it someway correct.
Show More