i am dividing the number &amp; want output only with one decimal like 4.1 or 4.2  "SELECT  count(*)/6 as s from t1 ";     &lt;td class = "inp"&gt;&lt;% out.print(rs.getDouble("s")); %&gt;&lt;/td&gt;   Please help, I am new to jsp
What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -&gt; 0.91239 0.912300 -&gt; 0.9123   What is the best way to achieve this in Java?
Entropy and the principle of least action Is there any link between the law of maximum entropy and the principle of least action. Is it possible to derive one from the other ? How can I deduce/identify an app from a notification icon? "strlen(s1) - strlen(s2)" is never less than zero Calculate half life of esters I'm trying to calculate the level of testosterone released from different testosterone esters. Here are some graphs of testosterone levels after single injections of 250mg of each ester.  Testo U    Testo B   Each ester have a specific half life. e.g. testo e have an half life of 4.5 days. testo b 29.5 testo u 20.9  After an injection of an ester, there will be a specific amount in your body. say 250mg.  Those 250mg will follow a normal half life curve for that ester. And I know how to calculate that.  However, when the ester is reduced, the testosterone bound to it will be released.  So over time , more testo will be released from the ester, and the testosterone itself have some sort of half life I assume.  Not doing drugs here ;) working on a medical app.  (sorry for the homework tag but I have no clue what this goes under..) Does there exist a symmetric matrix $A$  such that $2^{\sqrt{n}}\le |\operatorname{Tr}(A^n)|\le2020 \cdot2^{\sqrt{n}}$ for all $n$? I think no. The trace of $A^n$ equals $\sum\limits_{i=1}^n\lambda_i^n$ where $\lambda_i$ are the eigenvalues of $A$. Now, if the absolute value of trace of $A$ is bounded below by $2$, then I think the trace of $A^n$ will grow infinitely. Am I right? Thanks beforehand. Expectation inequality for a set and its subset. Given that a function $g(x)$ is a monotone increasing function. Its domain is an interval [c,d]. There are two sets $a_j \in A, j= 1,...,J$ and $b_k \in B,k=1,...,K$  on this interval, which satisfy $c_z \in C = B$\A and $c_z \geq a_j$ for all $a_j \in A$. For example, the interval $[c,d]=[0,8]$,$A=\{0,1,2,3,4,5\}$ and $B=\{0,1,2,3,4,5,6,7\}$. In this case, does the following inequality hold? If yes, could you give me some hints to prove that?  $$\frac{1}{K} \sum_{k=1}^{K}g(b_k) \geq \frac{1}{J} \sum_{j=1}^{J}g(a_j)$$ Does an unpublished document you upload to ResearchGate count as prior publication when submitting to a journal? On ResearchGate, if you upload something like a thesis, and then it says publish resources, does this mean the thesis becomes properly published in the sense of the usual requirements of journals that there be no prior publication of the submitted work?   I ask because I’m drafting thesis chapters into journal articles and did not choose to publish the thesis as a whole work in order to do so, so I want to make sure that by clicking publish resources I am not actually publishing the copy I’ve uploaded, I’m just making it publicly available? Does this mean it becomes published despite it not technically being a published work? (If so, I’ll just remove the copy I uploaded). Why do we have an elementary charge $e$ in physics but no elementary mass? Is an elementary mass ruled out by experiment or is an elementary mass forbidden by some theoretical reason? What are the different ways that a message can be displayed to a bash shell after a user logs in? Is there a single word for something that is simultaneously not interesting and not boring? I am looking for a word that would describe a concept or activity, such as playing a game X, that is1 neither boring nor interesting. In other words, it should mean ‘neutral’ wrt intrestingness (~ boringness) but still comparable on the scale of intrestingness to both ‘boring’ and ‘interesting’.  An example sentence would be  As far as I'm concerned, long-distance running is [insert word]; it is not boring but it's also not interesting.  Criteria2   Has to be unambiguous3, and may consist of two words at most. Has to be a single word. Should be formal in the sense that it is included in Cambridge Dictionary, or Merriam Webster, or both. Should not contain negating prefixes, such as ‘un-’.   Does such a word exist in the English language?  For readers' convenience, please state which criteria you believe your word suggestion has met. You may do so, e.g., by adding a disclaimer at the top or bottom of your answer. Simply writing (1., 2.) is sufficient.        1 Assume a ternary system of intrestingness.   2 If not all criteria can be met, you may relax  the requirements from bottom to top, in the following order: 4. -> 3.  -> 2. -> 1. Answers with the smallest number of relaxed criteria in this order will be preferred in accepting. For example, fulfilling  (1., 2., 3.) is better than achieving (1., 3., 4.). Situations where a  higher priority ordering fulfills fewer criteria than a lower priority  vector, such as (1.) vs (3.,  4.), will be assessed on a case-by-case  basis.   3 Words such as ‘unappealing’ thus even fail  criterium 1 because in a three-valued system ‘unappealing’ ~ ‘not  appealing’ ~ ‘not interesting’ can be taken to mean either ‘boring’ or  ‘neutral wrt intrestingness’. Is it safe to use file's hash as IV? I'm encrypting some files using AES in CBC mode.    I'm also using file's digest (SHA-1) to check that data is decrypted correctly (so I need to store it with file).  Is it safe to use this digest as AES's IV and store it in the header of file? Or it has security issue? Is there a way to get DateTime value from timestamp type column? Epsilon Delta Proof: How do I use the definitions to prove How to derive the formula for the sum of the first $n$ odd numbers: $n^2=\sum_{k=1}^n(2k-1).$ How to derive this formula?   $$n^2=\sum_{k=1}^n(2k-1).$$ ConcurrentModificationException Woes As we all know, immediate actions are just like swift actions, but can be performed outside of one's turn.     However, unlike a swift action, an immediate action can be performed at any time - even if it's not your turn.   However, it is still unclear if one can use an immediate action during someone else's action.  For example:  A monster swings at a conjurer.    Can conjurer abrupt jaunt outside monster's reach right after the attack was rolled, thus wasting an attack?  What about right after the damage was rolled, but not yet applied?  What about casting celerity and baleful transposition on yourself and monster's ally so the monster would hit his ally, given high enough attack roll?   Let's complicate a bit with a complex, full-round action on a monster's side.    Can one use immediate action in between attacks in full attack? What about after movement part of a charge? How to visualize the gradient as a one-form? I am reading Sean Carrol's book on General Relativity, and I just finished reading the proof that the gradient is a covariant vector or a one-form, but I am having a difficult time visualizing this. I usually visualize gradients as vector fields while I visualize one-forms with level sets. How to visualize the gradient as a one-form? Repeating "to" and "will" in enumerations of verbs Should I use the second "will" in constructions like this one: "it will definitely help you and will make the text more readable"  And should I write "to" before every infinitive in enumeration, or only before the first one, e.g. "it helps to develop and test" or "it helps to develop and to test"? Could this example be influenced by the fact that "help" can go with to-invinitive and bare infinitive, and with other verbs the rule would be different? Weird artifacts in my UV mapped texture Any ideas what's causing those chunks of geometric artifacts?  Argh. Are PHP short tags acceptable to use? Here's the information :     There are four different pairs of   opening and closing tags which can be   used in PHP. Two of those, &lt;?php ?&gt;   and &lt;script language="php"&gt; &lt;/script&gt;,   are always available. The other two   are short tags and ASP style tags, and   can be turned on and off from the   php.ini configuration file. As such,   while some people find short tags and   ASP style tags convenient, they are   less portable, and generally not   recommended.   In my experience most servers do have short tags enabled. Typing  &lt;?=   is far more convenient than typing  &lt;?php echo    The programmers convenience is an important factor, so why are they not recommended?