Prosze
1:
function regex(n: object) :: text:
if "%{_n}%" contains ".":
set {_s::*} to split "%{_n}%" at "."
set {_n} to "%a({_s::1})%.%last 2 characters of {_s::2}%"
return "%{_n}%"
else:
set {_n} to a("%{_n}%")
return "%{_n} ? 0%"
function a(b: text) :: text:
if length of {_b} > 3:
return "%a(first length of {_b} - 3 characters of {_b})% %last 3 characters of {_b}%"
return {_b}
i aby zmienic np. "10000" na "10 000" nalezy uzyc:
set {zmienna} to regex({liczba})
2:
replace all "k" in {ZMIENNA} with "000"