I am getting BigDecimal values in the scientific notation, i.e., 1E+3 and has a scale of -3. How do I convert it to 1000 with scale 0? I see that you can use toPlainString() and then is there a direct way of achieving this?
Transform a BigDecimal with a negative scale to a positive scale
1.2k Views Asked by user592748 At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in SCALE
- Rotate & Scale a gif animation using 2 finger gesture in Android using Fresco Library
- ggplot arrangeGrob scale colour and size
- What technologies should I use to create a real time One to One chat?
- Responsive image scaling by the height of the window
- mongodb shard geo documents
- CSS :hover transform scale command rotate object instead
- How do I scale the graphics of a game?
- Modular Scale line-heights
- Android avoid image scalling in Imageview for Image Mapping like Html
- Corona using object.Xscale to flip an object will cause the object to look skewed when calling object:scale(x,y)
- Android : Zoom by center pinch
- Perform scale operation on QWidget and its children
- scale texture opengl 2
- gimp: resize and "unsharp mask" via script
- ggplot R scale x log10 limits not working
Related Questions in BIGDECIMAL
- Performance Improvement For Using BigInteger While Calculating Square Root
- Error when exporting jasper reports to pdf
- Error With Big Decimal in Java
- RoundingMode.UNNECESSARY throws exception
- Million elements of PI in Java BBP formula
- Why are the calculated values different for the binomial upper cumulative probability?
- Ruby BigDecimal : increase number of initial digits saved in database
- How to retain trailing zeroes when converting BigDecimal to String
- Convert double (0.1) to BigRational and back
- How to sort a list of BigDecimal objects
- Remove the leading 0's till the decimal
- BigDecimal setScale method returning strange results
- Do I get wrong output with BigDecimal ROUND_HALF_EVEN rounding?
- Transform a BigDecimal with a negative scale to a positive scale
- Getting much higher precision with BigDecimal (or another class) in Java
Related Questions in SCIENTIFIC-NOTATION
- print double in scientific format with no integer part
- Can gnuplot use non-normalised scientific notation to label axis ticks?
- Transform a BigDecimal with a negative scale to a positive scale
- number represented as E in spite of using scipen in R
- Tableau fails to properly parse Number fields with the scentific notation
- VBA Round() function always returns zero when input is in scientific notation
- convert scientific notation to real number on ggplot python
- Using vstack to stack arrays on python but the floats change to scientific notation
- How small can a JavaScript number be without displaying in scientific notation?
- Is there a way to truncate scientific notation numbers in Javascript?
- How to display a floating point value as scientific parameter in Delphi
- Display CR values as scientific notation
- h:inputText changing to scientific notation
- Parse varying sized arrays in data structure - Java
- How to make C++ cout not use scientific notation
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If I understand you correctly,
d = d.setScale(0)will work:Output is:
Note that
BigDecimalis immutable, thus you have to reassign it.