Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
PLEASE GIVE ME SOLUTION TO GET SUM OF _price


for (int i = 0; i < countrows; i++)
{
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ImportData(_price[i]);
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ClearData();
}

What I have tried:

for (int i = 0; i < countrows; i++)
{
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ImportData(_price[i]);
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ClearData();
}
Posted
Updated 15-May-18 3:38am
v2
Comments
Richard Deeming 15-May-18 12:16pm    
REPOST
Your question title and description are the same as your previous question:
https://www.codeproject.com/Questions/1243104/How-can-get-sum-for-price[^]

The duplicated code block seems to bear no connection to the question.

1 solution

We aren't a "code to order" service: we do not do your work for you, nor do we do your homework.

But summing an array is trivial:
C#
var sum = _price.Sum();
Enumerable.Sum Method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900