lua-users home
lua-l archive

format() with string of length >= 100 containing '0円'

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi
In the Lua Reference manual is written that format() can only be used 
with strings that don't contain '0円'.
For this reason, I use format("%s") to cut the characters following the 
first '0円' from a string.
It works fine until I use a string of length greater than or equal to 
100 characters.
For example:
strlen(format("%s", "1" .. strrep("000円", 98))) --> 1
strlen(format("%s", "1" .. strrep("000円", 99))) --> 100
strlen(format("%s", "000円" .. strrep("1", 98))) --> 0
strlen(format("%s", "000円" .. strrep("1", 99))) --> 100
format() executes "addnchar(L, s, l)" with string of length >= 100, and 
addnchar() includes also the embeded '0円'.
Is it the right way to change this statement with "addnchar(L, s, strlen
(s))" ?
Bye
Mauro

AltStyle によって変換されたページ (->オリジナル) /