Click here to Skip to main content
15,913,587 members
Home / Discussions / C#
   

C#

 
Generalreduce precision Pin
Xmen Real 15-Feb-08 1:21
professional Xmen Real 15-Feb-08 1:21 
GeneralRe: reduce precision Pin
phannon8615-Feb-08 1:30
professionalphannon8615-Feb-08 1:30 
GeneralRe: reduce precision Pin
Xmen Real 15-Feb-08 1:34
professional Xmen Real 15-Feb-08 1:34 
GeneralRe: reduce precision Pin
DaveyM6915-Feb-08 1:41
professionalDaveyM6915-Feb-08 1:41 
GeneralRe: reduce precision Pin
Xmen Real 15-Feb-08 1:48
professional Xmen Real 15-Feb-08 1:48 
GeneralRe: reduce precision Pin
Guffa15-Feb-08 10:33
Guffa15-Feb-08 10:33 
GeneralRe: reduce precision Pin
DaveyM6915-Feb-08 10:50
professionalDaveyM6915-Feb-08 10:50 
GeneralRe: reduce precision Pin
Luc Pattyn15-Feb-08 5:31
sitebuilderLuc Pattyn15-Feb-08 5:31 
Hi,

if the values well are within int limits, then you can do things such as:
float b = Convert.ToSingle(a);
int b4= (int)(10000.0*b+0.5);
b=0.0001*b4;


This does not create any objects; variants of it will all have similar performance.
Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: reduce precision Pin
Xmen Real 15-Feb-08 5:36
professional Xmen Real 15-Feb-08 5:36 
GeneralRe: reduce precision Pin
Luc Pattyn15-Feb-08 5:58
sitebuilderLuc Pattyn15-Feb-08 5:58 
GeneralRe: reduce precision Pin
Xmen Real 15-Feb-08 6:10
professional Xmen Real 15-Feb-08 6:10 
GeneralRe: reduce precision Pin
Luc Pattyn15-Feb-08 6:17
sitebuilderLuc Pattyn15-Feb-08 6:17 
GeneralRe: reduce precision Pin
Xmen Real 15-Feb-08 6:19
professional Xmen Real 15-Feb-08 6:19 
GeneralRe: reduce precision Pin
Xmen Real 15-Feb-08 18:48
professional Xmen Real 15-Feb-08 18:48 
GeneralRe: reduce precision Pin
Guffa15-Feb-08 10:39
Guffa15-Feb-08 10:39 
GeneralRe: reduce precision Pin
Luc Pattyn15-Feb-08 10:43
sitebuilderLuc Pattyn15-Feb-08 10:43 
GeneralRe: reduce precision Pin
Guffa15-Feb-08 12:44
Guffa15-Feb-08 12:44 
GeneralRe: reduce precision Pin
Luc Pattyn15-Feb-08 12:47
sitebuilderLuc Pattyn15-Feb-08 12:47 
QuestionHow to set tab order in DataGridView?? Pin
Neo Andreson15-Feb-08 1:21
Neo Andreson15-Feb-08 1:21 
AnswerRe: How to set tab order in DataGridView?? Pin
Xmen Real 15-Feb-08 1:32
professional Xmen Real 15-Feb-08 1:32 
Questionhow to assign multiple image in ButtonField using .net with c# Pin
sugunavathy15-Feb-08 1:15
sugunavathy15-Feb-08 1:15 
AnswerRe: how to assign multiple image in ButtonField using .net with c# Pin
Nouman Bhatti15-Feb-08 1:24
Nouman Bhatti15-Feb-08 1:24 
GeneralRe: how to assign multiple image in ButtonField using .net with c# Pin
sugunavathy15-Feb-08 1:35
sugunavathy15-Feb-08 1:35 
GeneralOdd Form Display problem Pin
Sam Shiles15-Feb-08 0:52
Sam Shiles15-Feb-08 0:52 
GeneralRe: Odd Form Display problem Pin
Sam Shiles15-Feb-08 1:01
Sam Shiles15-Feb-08 1:01 

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.