Click here to Skip to main content
15,891,943 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: Rounding Pin
DaveAuld7-Sep-14 19:34
professionalDaveAuld7-Sep-14 19:34 
GeneralRe: Rounding Pin
PaulowniaK7-Sep-14 19:46
PaulowniaK7-Sep-14 19:46 
GeneralRe: Rounding Pin
Agent__0077-Sep-14 19:57
professionalAgent__0077-Sep-14 19:57 
GeneralRe: Rounding Pin
DaveAuld7-Sep-14 19:57
professionalDaveAuld7-Sep-14 19:57 
GeneralRe: Rounding Pin
PaulowniaK7-Sep-14 20:11
PaulowniaK7-Sep-14 20:11 
GeneralRe: Rounding Pin
Jörgen Andersson7-Sep-14 19:59
professionalJörgen Andersson7-Sep-14 19:59 
GeneralRe: Rounding Pin
PaulowniaK7-Sep-14 20:12
PaulowniaK7-Sep-14 20:12 
AnswerRe: Rounding Pin
Michael Pauli8-Sep-14 0:03
Michael Pauli8-Sep-14 0:03 
C#
The 1.5 -> 1 is a little strange. Except for that you can use

double MagicFormula(double x)
{
     var d = Math.Log10(x);
     var f = Math.Pow(10.0, d);
     var res = Math.Round(x / f, 0) * f;
     var res2 = Math.Round(res, 0);
     return res2;
}

Michael Pauli

AnswerRe: Rounding Pin
newton.saber8-Sep-14 2:16
newton.saber8-Sep-14 2:16 
GeneralHTML5 - your thoughts please Pin
Chris Maunder7-Sep-14 16:35
cofounderChris Maunder7-Sep-14 16:35 
GeneralRe: HTML5 - your thoughts please Pin
_Maxxx_7-Sep-14 18:16
professional_Maxxx_7-Sep-14 18:16 
GeneralRe: HTML5 - your thoughts please Pin
Kornfeld Eliyahu Peter7-Sep-14 20:28
professionalKornfeld Eliyahu Peter7-Sep-14 20:28 
GeneralRe: HTML5 - your thoughts please Pin
JMK-NI7-Sep-14 23:17
professionalJMK-NI7-Sep-14 23:17 
GeneralRe: HTML5 - your thoughts please Pin
BillWoodruff7-Sep-14 23:36
professionalBillWoodruff7-Sep-14 23:36 
GeneralRe: HTML5 - your thoughts please Pin
Rowdy Raider8-Sep-14 3:32
Rowdy Raider8-Sep-14 3:32 
GeneralRe: HTML5 - your thoughts please Pin
Paulo Zemek8-Sep-14 7:57
mvaPaulo Zemek8-Sep-14 7:57 
GeneralRe: HTML5 - your thoughts please Pin
C-P-User-38-Sep-14 10:07
C-P-User-38-Sep-14 10:07 
GeneralRe: HTML5 - your thoughts please Pin
ClockMeister9-Sep-14 5:16
professionalClockMeister9-Sep-14 5:16 
GeneralI wish they were liars. Pin
MehGerbil7-Sep-14 5:35
MehGerbil7-Sep-14 5:35 
GeneralRe: I wish they were liars. Pin
Mike Hankey7-Sep-14 7:14
mveMike Hankey7-Sep-14 7:14 
GeneralRe: I wish they were liars. Pin
OriginalGriff7-Sep-14 7:50
mveOriginalGriff7-Sep-14 7:50 
GeneralRe: I wish they were liars. Pin
Mike Hankey7-Sep-14 8:01
mveMike Hankey7-Sep-14 8:01 
GeneralRe: I wish they were liars. Pin
OriginalGriff7-Sep-14 8:19
mveOriginalGriff7-Sep-14 8:19 
GeneralRe: I wish they were liars. Pin
Rage7-Sep-14 9:42
professionalRage7-Sep-14 9:42 
GeneralRe: I wish they were liars. Pin
Kenneth Haugland7-Sep-14 10:21
mvaKenneth Haugland7-Sep-14 10:21 

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.