# Problem

• 02-06-2008
manohar.amit
Problem
All inputs are strings where user enters nums

Pressing “1” Key: it will show - 000.01
Pressing “2” Key: it will show - 000.12
Pressing “3” Key: it will show - 001.23
Pressing “4” Key: it will show - 012.34
Pressing “5” Key: it will show - 123.45

Can ne1 help me cracking the Algo
• 02-06-2008
Elysia
Graphical User Interface? If so, then what platform?
• 02-06-2008
vart
12345.0 divide by 1e[n]

where [n] is 7 - number entered by user
the result should be printed with format like &#37;06.2f (or corresponding width/precision modifiers for ostream)
• 02-06-2008
matsp
Or, similar to varts solution, start with a multiplier of 0.01, multiply the input with this, and multiply the multiplier by 10 for each digit that comes in.

--
Mats
• 02-06-2008
manohar.amit
Quote:

Originally Posted by Elysia
Graphical User Interface? If so, then what platform?

i work on Qtopia , so i m dealing with QStrings not normal strings .
• 02-07-2008
manohar.amit
Quote:

Originally Posted by manohar.amit
i work on Qtopia , so i m dealing with QStrings not normal strings .

Hi Elysia
Goddess of the Sky

I need help I am in deep ........
• 02-07-2008
Elysia
I don't know QTopia and I don't know QStrings...
I only know good old C/C++, Win32 and MFC.
• 02-07-2008
manohar.amit
Quote:

Originally Posted by Elysia
I don't know QTopia and I don't know QStrings...
I only know good old C/C++, Win32 and MFC.

okie then how to go about it in a normal string fashion.............:)
• 02-07-2008
matsp
Fill the string with "000.00".
Keep a count of how many characters you have received.
Use a table of [0, 1, 3, 4, 5] as index, then shift each character into the index.

--
Mats
• 02-07-2008
manohar.amit
Quote:

Originally Posted by matsp
Fill the string with "000.00".
Keep a count of how many characters you have received.
Use a table of [0, 1, 3, 4, 5] as index, then shift each character into the index.

--
Mats

everything will happen at run time !!!!!
thats the issue
• 02-07-2008
Mario F.