![]() |
|
[Python] How to convert numbers into SI unit numbers? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] How to convert numbers into SI unit numbers? (/showthread.php?tid=3467296) |
How to convert numbers into SI unit numbers? - Echoe - May 9, 2013 Okay so i have an assignment and I need to convert numbers into SI units. For example 1212131A into 1.21MA or 0.334A into 3.34mA thanks * - zapfen - May 12, 2013 Just simple calculate it: 1212131A / 100 = 1.21MA 0.334A * 10 = 3.34mA Or what exacly do you mean? -Zapfen * - DevouringChain8 - May 12, 2013 (May 9, 2013 06:15 AM)Echoe Wrote: Okay so i have an assignment and I need to convert numbers into SI units. By any Chance do you go to Grace? -Chain * - Echoe - May 12, 2013 (May 12, 2013 03:12 AM)zapfen Wrote: Just simple calculate it: 1212131A / 100 = 1.21MA Jump. From nearest. Building. Anyone with some common sense? * - skadoosh369 - May 12, 2013 Using string or list operations detect the last two characters which will be unit of the quantity. Like this Code import stringrun this code, it will detect unit from the entered figure This is the output Code >>> It does not detect abbreviations for 'micro'(μ),'ohm'(Ω) etc.. you can add them and form a character map After extracting the unit from the entered figure write a program to convert it to a target unit based on SI standards. * - zapfen - May 12, 2013 (May 12, 2013 02:34 PM)Echoe Wrote: Jump. From nearest. Building. cmon, then ask questions which make sense, damn or should i gues what you want to know? * - Poppins - May 13, 2013 (May 12, 2013 02:34 PM)Echoe Wrote: Jump. From nearest. Building. Why should we help you when you act like a dick to anyone that answers? * - Echoe - May 14, 2013 (May 13, 2013 11:49 AM)Poppins Wrote: Why should we help you when you act like a dick to anyone that answers? Uh he was clearly being stupid.. ? -_- * - Poppins - May 14, 2013 (May 14, 2013 12:32 AM)Echoe Wrote: Uh he was clearly being stupid.. ? -_- No he wasn't. That's the correct answer actually. * - Echoe - May 14, 2013 Hum no it's not. If he wasn't then he must of misunderstood what I was asking, and how can you tell me it's the correct answer to my question when it's me who is asking it? I'm sorry but don't bother commenting again and don't be an ass and neg rep like a lil bitch. It was a misunderstanding * - Poppins - May 14, 2013 (May 14, 2013 03:32 AM)Echoe Wrote: Hum no it's not. If he wasn't then he must of misunderstood what I was asking, and how can you tell me it's the correct answer to my question when it's me who is asking it? You asked how to convert the specified units to the values provided. If you plug your values into his script, you get the answer you were looking for. * - glob - May 14, 2013 (May 14, 2013 04:13 AM)Poppins Wrote: You asked how to convert the specified units to the values provided. If you plug your values into his script, you get the answer you were looking for. This ^. Avoid being pissy when asking for help, and you can avoid -9 rep. * - skadoosh369 - May 14, 2013 (May 9, 2013 06:15 AM)Echoe Wrote: Okay so i have an assignment and I need to convert numbers into SI units. By the way A(ampere) is an SI unit , you said that you need to convert numbers to SI. In the example you did just the opposite. Are you asking for a converter... |