Difficult Question on decimal placing

  • Context: MHB 
  • Thread starter Thread starter Elementry
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on extracting and manipulating decimal values in numbers using programming or software tools like Excel. The user seeks a method to isolate digits on both sides of the decimal point, specifically to combine left and right decimal placements. A solution involves using powers of 10 to shift the decimal and the int() function to truncate values. The conversation highlights the need for clarity on the mathematical operations and programming techniques required for such tasks.

PREREQUISITES
  • Basic understanding of decimal numbers and their structure
  • Familiarity with Excel functions and formulas
  • Knowledge of programming concepts, specifically the int() function
  • Understanding of mathematical operations involving powers of 10
NEXT STEPS
  • Research how to use Excel's LEFT and RIGHT functions for string manipulation
  • Learn about the int() function in Python or JavaScript for number truncation
  • Explore mathematical concepts related to powers of 10 and their applications
  • Investigate programming libraries that facilitate numerical operations, such as NumPy for Python
USEFUL FOR

This discussion is beneficial for data analysts, software developers, and anyone working with numerical data manipulation in Excel or programming environments.

Elementry
Messages
1
Reaction score
0
Hi All,

Trying to find a program or (excel) or any software which allows you to cross over both sides of the decimal place. I want to extract left and right of the decimal and add in rules . I can't seem to find any programs to do this.
Any help would be good.

1. entering a number say - 1234.45

i would like to do two things, select the right side decimal numbers plus the 1st left placing. = 445 beocmes the number

And i would like to be able to extract the next decimal over so 1234.45 becomes 344.5 .

im not sure what this is called or how to achcieve it in excel or any math program , any help would be good.

PS - obviously id like to be able to go 2 left placing and two right combined so the example above would be : 1234.45 would be 3445

appreaciate any help or idea what this type of math is called or comes under

thkx
 
Physics news on Phys.org
Hello Elementry,

I have moved this topic, as it is more of a programming question than one of mathematics, although some basic math is involved.

To move the decimal point, multiplying by a power of 10 will do the trick. A positive power moves it to the right, while a negative power moves it to the left.

Then, to strip off the digits to the right of the decimal point, you could use the int(x) function intrinsic to most programming languages, known as the floor or greatest integer function in mathematics, to accomplish this. For example:

1234.45 - int(1234.45) = 0.45

Will your data always have the format xxxx.xx?
 

Similar threads

Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K