如何在C#中创建一个函数,在底部我在excel文件中有这个函数 [英] How to creat a function in C#, in the bottom I have this function in excel file
本文介绍了如何在C#中创建一个函数,在底部我在excel文件中有这个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
早上好
i想在C中创建一个函数。
问题是我有什么东西可供选择:
这是Excel中的等式:
Good morning
i want to create a function in C#
the probleme is there's somthing complecated for me :
this's the equation in Excel :
=SLN(price;0;(date_saisie*12))*ROUNDDOWN(DAYS360(date_saisie;Now();TRUE) / 30;)
注意:这是一个Excel公式,其中;
替换昏迷,因为昏迷已经被使用作为小数点分隔符(本地文化)。
我尝试过:
jevousremerciétousles membres qui participent a ce论坛
Bien Cordialement ...
感谢参加此论坛的所有成员
祝你好运...
Nota: This is an Excel formula where ;
replace comas because the coma is already used as decimal separator (local culture) .
What I have tried:
je vous remercié tous les membres qui participent a ce Forum
Bien Cordialement...
Thank you all the members who participate in this Forum
Best regards...
推荐答案
你必须查找Excel函数正在做什么并在C#中实现类似的计算:
SLN功能 - Office支持 [ ^ ]
阅读直线折旧:数学公式 - 直线折旧方法:Educalc.net [ ^ ]
DAYS360功能 - Office支持 [ ^ ]
参见 360天日历 - 维基百科 [ ^ ]和<小时ef =https://www.codeproject.com/Articles/556457/Difference-between-dates-using-a-day-calendar>使用360天日历的日期之间的差异 [ ^ ]。
ROUNDDOWN(x / 30)
只需使用x / 30
当x
是一个整数时。如果x
是浮点数,则将除法结果转换(强制转换)为整数。
You have to lookup what the Excel functions are doing and implement similar calculations in C#:
SLN function - Office Support[^]
Read about "straight-line depreciation": Mathematical Formula - Straight Line Depreciation Method : Educalc.net[^]
DAYS360 function - Office Support[^]
See 360-day calendar - Wikipedia[^] and Difference between dates using a 360 day calendar[^].
ROUNDDOWN(x / 30)
Just usex / 30
whenx
is an integer. Ifx
is a floating point number, convert (cast) the result of the division to an integer.
这篇关于如何在C#中创建一个函数,在底部我在excel文件中有这个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文