<?xml version="1.0" encoding="UTF-8"?>
<test id="wmlscriptlib/string/format/f/1" class="C" scope="wmlscriptlib:float" testtype="application" type="auto" source="wmlssl12#9.16" device="both">
  <assertion>When the String.format function is called with parameters string "Format", a
floating point "Value" and the "Format" contains a format specifier of the
form "%f", the function replaces the "%f" with a representation of the value
of the floating point using the form  [-]d.nnnnnn (where nnnnnn represents
the default of six digits after the decimal point in the string it returns).
</assertion>
  <specnote>Tests that; 1 evaluates to 1.000000, -1 evaluates to -1.000000,
1.1 evaluates to 1.100000 and -1 evaluates tp -1.100000</specnote>
  <results>
    <result>
      <name>test</name>
      <value>pass</value>
    </result>
  </results>
  <method>
    <![CDATA[<card newcontext="true" id="main">
<onevent type="onenterforward">
<go href="<script1>#main('test','card1')"/>
</onevent>
<auto_failed>
</card>]]>
  </method>
  <cards>
    <card id="1">
      <![CDATA[<card id="card1">
<onevent type="onenterforward">
<go href="<resulturl>">
<postfield name="test" value="$test"/>
<sessionvars>
</go>
</onevent>
<auto_failed>
</card>
]]>
    </card>
  </cards>
  <scripts>
    <script id="1">
      <![CDATA[extern function main(myvar,next) {
	var result = 'fail';
	var fstring = "test %f string";
	var x = "";

	if ((String.format(fstring, 1.0) == "test 1.000000 string")) {
		x = "a";
	}

	if ((String.format(fstring, -1.0) == "test -1.000000 string")) {
		x = x + "b";
	}

	if ((String.format(fstring, 1.1) == "test 1.100000 string")) {
		x = x + "c";
	}

	if ((String.format(fstring, -1.1) == "test -1.100000 string")) {
		x = x + "d";
	}

	if (x == "abcd") {
		result = 'pass';
	}

	WMLBrowser.setVar(myvar, result);
	WMLBrowser.go('#' + next);
	return 1;
}
]]>
    </script>
  </scripts>
</test>

