anchor.diff:     end;
   string_to_type(decimal, Str) ->
      try
  -      case re:split(Str, "[.]", [{return, list}]) of
  -         [Num] ->
  -            {list_to_integer(Num), 0};
  -         [[], Remainder] ->
  -            {list_to_integer(Remainder), -length(Remainder)};
  -         [Num, []] ->
  -            {erlang:list_to_integer(Num), 0};
  -         [Num, Remainder] ->
  -            {list_to_integer(Num) * round(math:pow(10, length(Remainder))) + list_to_integer(Remainder), -length(Remainder)}
  -      end
  +      str_to_decimal(Str)
      catch
         _:_ ->
            Reason = list:flatten(io_lib:format("Unable to convert ~p to decimal", [Str])),
  
positive.code: -module(erlang_fast_xml).
  
  -author("Dmitry Melnikov <dmitryme@gmail.com>").
  
  -include_lib("xmerl/include/xmerl.hrl").
  -include("erlang_fast_template.hrl").
  
negative.code: 
  string_to_type_test() ->
     ?assertEqual(100123, string_to_type(int32, "100123")),
     ?assertEqual({1012, -3}, string_to_type(decimal, "1.0120")),
     ?assertEqual({-1012, -3}, string_to_type(decimal, "-001.012")),
     ?assertEqual({21, 0}, string_to_type(decimal, "21.0")),
     ?assertEqual({12, 3}, string_to_type(decimal, "12000")),
     ?assertEqual({-12, 3}, string_to_type(decimal, "-12000")),
     ?assertEqual({1, 0}, string_to_type(decimal, "1.")),
     ?assertEqual({0, 0}, string_to_type(decimal, ".0")),
     ?assertEqual({0, 0}, string_to_type(decimal, "0.0")),
     ?assertEqual({0, 0}, string_to_type(decimal, "00.0000")),
     ?assertEqual({1, 1}, string_to_type(decimal, "10")),
     ?assertEqual({1, -1}, string_to_type(decimal, ".1")),
     ?assertEqual({1123, -4}, string_to_type(decimal, ".1123")),
     ?assertEqual({12345, -4}, string_to_type(decimal, "1.2345")),
  