- Removing 0's from a string value?
- 19 Feb 2015 11:39:35 am
- Last edited by AkonSpy on 19 Feb 2015 12:47:11 pm; edited 3 times in total
I have this code/program which displays the possible factors of a given value:
Code:
Is their a way to remove the zeros?…
For example, if the answer is displayed:
N=?96
96 * 01
48 * 02
32 * 03
24 * 04
16 * 06
12 * 08
Done
I want it to be displayed as:
N=?96
96 * 1
48 * 2
32 * 3
24 * 4
16 * 6
12 * 8
Done
Code:
:0->dim(L1
:Prompt N
:For(I,1,sqrt(N
:If not(fPart(N/I
:N/I+I.01->L1(1+dim(L1
:End
:For(I,1,dim(L1
:{0,1->L2
:{0,L1(I->L3
:LinReg(ax+b) L2,L3,Y1
:Equ>String(Y1,Str1
:inString(Str1,".
:Disp sub(sub(Str1,1,Ans-1)+" * "+sub(Str1,Ans+1,length(Str1)-Ans),1,length(Str1)-1
:End
Is their a way to remove the zeros?…
For example, if the answer is displayed:
N=?96
96 * 01
48 * 02
32 * 03
24 * 04
16 * 06
12 * 08
Done
I want it to be displayed as:
N=?96
96 * 1
48 * 2
32 * 3
24 * 4
16 * 6
12 * 8
Done