Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to update the datas present in textbox to gridview control (gui) ,SQL2005 Pin
Noctris10-May-09 12:06
Noctris10-May-09 12:06 
QuestionProblem in Printing a persian(or arabic) document Pin
Roshanakak9-May-09 19:18
Roshanakak9-May-09 19:18 
AnswerRe: Problem in Printing a persian(or arabic) document Pin
Ramin Barati19-May-09 8:50
Ramin Barati19-May-09 8:50 
QuestionPreferred way of bytes to kbytes conversion? Pin
harold aptroot9-May-09 12:22
harold aptroot9-May-09 12:22 
AnswerRe: Preferred way of bytes to kbytes conversion? Pin
Christian Graus9-May-09 12:28
protectorChristian Graus9-May-09 12:28 
GeneralRe: Preferred way of bytes to kbytes conversion? Pin
harold aptroot9-May-09 12:32
harold aptroot9-May-09 12:32 
GeneralRe: Preferred way of bytes to kbytes conversion? Pin
Christian Graus9-May-09 12:38
protectorChristian Graus9-May-09 12:38 
AnswerRe: Preferred way of bytes to kbytes conversion? Pin
Luc Pattyn9-May-09 12:37
sitebuilderLuc Pattyn9-May-09 12:37 
Don't expect MS to be consistent.

I have a single method that takes both the exact value and a minimum value, and returns a string expressing the size as an integer number in either giga/mega/kilo/byte making sure the number is greater/equal the minimum value. So calling it with (10240, 11) would return "10240", whereas calling it with (10240, 9) would return "10K"

I round up, i.e. add 1023 and divide by 1024.
That way a 10K file fits in a 10K space (well, that is hoping space never gets rounded up).

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Preferred way of bytes to kbytes conversion? Pin
harold aptroot9-May-09 12:41
harold aptroot9-May-09 12:41 
GeneralRe: Preferred way of bytes to kbytes conversion? Pin
Luc Pattyn9-May-09 12:59
sitebuilderLuc Pattyn9-May-09 12:59 
GeneralRe: Preferred way of bytes to kbytes conversion? Pin
harold aptroot9-May-09 13:06
harold aptroot9-May-09 13:06 
GeneralRe: Preferred way of bytes to kbytes conversion? Pin
Luc Pattyn9-May-09 13:09
sitebuilderLuc Pattyn9-May-09 13:09 
GeneralEnabling Secondry Monitor using C# Pin
jonesyx9-May-09 9:24
jonesyx9-May-09 9:24 
GeneralRe: Enabling Secondry Monitor using C# Pin
Luc Pattyn9-May-09 12:29
sitebuilderLuc Pattyn9-May-09 12:29 
Questiondatagrid copy Pin
michaelgr19-May-09 7:44
michaelgr19-May-09 7:44 
AnswerRe: datagrid copy Pin
Mycroft Holmes9-May-09 14:32
professionalMycroft Holmes9-May-09 14:32 
Questionsend and recieve data with modem Pin
mehdi rahimzade9-May-09 4:31
mehdi rahimzade9-May-09 4:31 
AnswerRe: send and recieve data with modem Pin
Mohammad Dayyan9-May-09 5:42
Mohammad Dayyan9-May-09 5:42 
AnswerRe: send and recieve data with modem Pin
Rajdeep.NET is BACK9-May-09 6:46
Rajdeep.NET is BACK9-May-09 6:46 
GeneralRe: send and recieve data with modem Pin
mehdi rahimzade9-May-09 8:18
mehdi rahimzade9-May-09 8:18 
GeneralRe: send and recieve data with modem PinPopular
scottgp9-May-09 8:46
professionalscottgp9-May-09 8:46 
GeneralRe: send and recieve data with modem Pin
Henry Minute9-May-09 9:58
Henry Minute9-May-09 9:58 
AnswerRe: send and recieve data with modem Pin
mehdi rahimzade9-May-09 8:13
mehdi rahimzade9-May-09 8:13 
GeneralRe: send and recieve data with modem Pin
Colin Angus Mackay9-May-09 13:03
Colin Angus Mackay9-May-09 13:03 
AnswerRe: send and recieve data with modem Pin
mehdi rahimzade9-May-09 9:46
mehdi rahimzade9-May-09 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.