Last post May 11, 2017 02:51 AM by Eric Du
May 10, 2017 10:39 PM|nikoo56|LINK
Can anyone help me how to convert this line of VB code TO C#
PrincipalPayment = System.Math.Ceiling(FormatNumber(-PPmt(lRate / 1200, i, lTerm, lStartLoanBalance), 3) * 100) / 100
May 10, 2017 10:58 PM|KathyW|LINK
http://converter.telerik.com/ would say:
PrincipalPayment == System.Math.Ceiling(Strings.FormatNumber(-Financial.PPmt(lRate / 1200, i, lTerm, lStartLoanBalance), 3) * 100) / 100
I haven't tested it.
May 10, 2017 11:16 PM|nikoo56|LINK
Yes, I exaclty got same but it gave me error on -Financial.ppmt that is not existed in C#.
May 11, 2017 02:51 AM|Eric Du|LINK
According to your description and error message, as far as I know, this method(Financial.ppmt) is belong to the
Microsoft.VisualBasic, please check this property in this official document:
So my suggestion is use the following code to add reference:
Here are someone who meet the similar problem as you, please check:
VB “Financial.Pmt” equivalent in C#?