TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Devendra Dubey
NA
73
653
Same formula working in JavaScript but not in C#
Aug 2 2017 5:35 AM
This JavaScrpit function produce Correct Result
<script type="text/javascript">
function Function() {
amount = document.getElementById("Amount").value;
months = document.getElementById("Months").value;
intrest = document.getElementById("Intrest").value;
quaters = Math.floor(months / 3);
monthpayment = parseInt(amount) * ((Math.pow(intrest / 400 + 1, quaters) - 1) / (1-(Math.pow(intrest / 400 + 1,(-1/3)))));
document.getElementById("MaturityAmt").value = monthpayment.toFixed(2);
}
</script>
But Same logic not working in C#
void MyFunction()
{
double amount =Convert .ToDouble ( textBox1.Text) ;
double months =Convert .ToDouble ( textBox2.Text) ;
double intrest =Convert .ToDouble ( textBox3.Text) ;
double quaters = Math.Floor (months / 3);
double maturityamt = int.Parse (textBox1.Text ) * ((Math.Pow (intrest / 400 + 1, quaters) - 1) / (1 - (Math.Pow (intrest / 400 + 1, (-1 / 3)))));
textBox4.Text = maturityamt.ToString ();
}
Reply
Answers (
6
)
Regarding private and public key encryption
How to see Calendar Extender inside GridView c#