Hi there,
I have several hundred statistical data sets, which are being displayed on the fly. The values can vary between 0.001 and 10000000 for the different sets.
Now, when displaying some statistics like min and max, it is ok to strip the decimal places for most of the variables, but not for all.
293873982.35 becomes 293873982
0.04 becomes 0
So, I implemented a series of IFs, to specify that if the value is between 1 and 10, than 1 decimal; if smaller as 1 than 2....
But I wonder if there is a more elegant way to this. A small mathematical algorithm, which does it "better".
Thanks for any ideas!
5 1312
You mean significant figures? That's not mine, just someone else's function I found for you.
Interesting, could use this one for another part of the project. But no, I think more in the terms of "pay attention when to show how many decimals, depending on the "size" of the number".
So, I think it's close to what I want, but not really.
what about scientific display (like 1.234e+8 or 1.234e-2), maybe that's close to what you want?
@Dormilich
No, thanks, but that's too complicated for "normal" users. :-)
@luftikus143
I'm afraid the normal number rounding options of decimal places or significant figures are pretty much the only standard. If you show us your code already done we can maybe streamline it, but I doubt you will find a single function without making your own.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: svilen |
last post by:
hello again.
i'm now into using python instead of another language(s) for
describing structures of data, including names, structure,
type-checks, conversions, value-validations, metadata etc....
|
by: Paul Rubin |
last post by:
I'm trying the super() function as described in Python Cookbook, 1st ed,
p. 172 (Recipe 5.4).
class A(object):
def f(self):
print 'A'
class B(object):
def f(self):
|
by: pjac |
last post by:
I need assistance in creating an Automatic tracking number that
appears in a textbox that looks like: 2004-001. The first part of the
number is based on the year, the second part is generated from...
|
by: Natan |
last post by:
When you create and aspx page, this is generated by default:
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Configuration;
using System.Text;
using...
|
by: Russell Mangel |
last post by:
I am using VS2005.
When I paste source code into the code window, VS2005 formats like the
following:
public MsgRecipientReader()
: base()
{
}
|
by: dcyale |
last post by:
I have a report with the following paragraph:
="This BA presents a " & & " determination for the " & & " and associated habitat. We would appreciate you processing the biological opinion by " &...
|
by: bryars |
last post by:
I want to write some SQL which results in an automatic conversion of a
datetime to a string in a format suitable for the Language of the
connection (either by explicitly setting the Language in the...
|
by: swamimeenu |
last post by:
Hi,
I need to add a automatic serial number in datareport in vb without having tht field in database..
but the remaining fields are connected from db...
how to generate automatic serial number...
|
by: trss |
last post by:
Has anyone experienced automatic memoization by any C++ compiler
before?
The program coded as a solution for the problem based on the famous 3n
+1 problem, both of which are given below, is...
|
by: Pittaman |
last post by:
Hello
I am creating some crystal reports (for visual studio 2005) based on the content of certain .NET objects. I'm doing this in .NET 2.0.
For one of them I'm using a Cross-table to summarize...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |