rounding - How can i round float to nearest whole number and then convert into double in JAVA? -


मेरे पास फ्लोट वैल्यू है

  float myValue = 5.1824203 ;   
  • मैं फ्लोट को निकटतम पूर्ण संख्या में कैसे ले सकता हूँ और फिर डबल में रूपांतरित कर सकता हूं?
  • इसे प्राप्त करने का सबसे अच्छा तरीका क्या है? < / Ul>

    धन्यवाद,

      डबल myRoundedDoubleValue = Math.round (myValue);    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -