How to count how many times a character(0) appears in a string
I'm looking for a way of counting how many times 0 will apear in a string like 3000.
I'll use it to complete my scientific notation calculator.
I know there are some parts missing, specially the negative numbers but here it is what I got til now.
display dialog "Big Number" default answer ""
set nB to text returned of result
set fnB to first character of nB as integer
set nZ to (last character of nB) / fnB as integer
if nZ = 0 then
repeat while nB ≥ 10
set nB to nB / 10
end repeat
end if
set s1 to " X 10"
set nB to nB as string
display dialognB & s1
Mac mini