diff --git a/lib/twine/placeholders.rb b/lib/twine/placeholders.rb index bc44d05..63dd793 100644 --- a/lib/twine/placeholders.rb +++ b/lib/twine/placeholders.rb @@ -24,7 +24,7 @@ module Twine # %@ -> %s value = convert_twine_string_placeholder(input) - number_of_placeholders = number_of_twine_placeholders(input) + number_of_placeholders = number_of_twine_placeholders(value) return value if number_of_placeholders == 0 diff --git a/test/test_placeholders.rb b/test/test_placeholders.rb index 3fcd5a6..abc3ab2 100644 --- a/test/test_placeholders.rb +++ b/test/test_placeholders.rb @@ -79,6 +79,10 @@ class PlaceholderTest < TwineTest to_android("some %d second %2$f") end end + + def test_complicated_float_placeholders + assert_equal "%1$.0f%2$s (apparent: %3$.0f)", to_android("%.0f%@ (apparent: %.0f)") + end end class FromAndroid < PlaceholderTest