Code example for DecimalFormatSymbols

Methods: setGroupingSeparator

0
	public void testProcess() throws Exception { 
		FromJsclSimplifyTextProcessor tp = new FromJsclSimplifyTextProcessor();
		//Assert.assertEquals("(e)", tp.process("(2.718281828459045)")); 
		//Assert.assertEquals("ee", tp.process("2.718281828459045*2.718281828459045")); 
		//Assert.assertEquals("((e)(e))", tp.process("((2.718281828459045)*(2.718281828459045))")); 
		DecimalFormatSymbols decimalGroupSymbols = new DecimalFormatSymbols();
		decimalGroupSymbols.setGroupingSeparator(' ');
		Locator.getInstance().getEngine().setDecimalGroupSymbols(decimalGroupSymbols);
		//Assert.assertEquals("123 456 789e", tp.process("123456789*2.718281828459045")); 
		//Assert.assertEquals("123 456 789e", tp.process("123 456 789 * 2.718281828459045")); 
		//Assert.assertEquals("t11e", tp.process("t11*2.718281828459045")); 
		//Assert.assertEquals("e", tp.process("2.718281828459045")); 
		//Assert.assertEquals("tee", tp.process("t2.718281828459045*2.718281828459045")); 
 
		Locator.getInstance().getEngine().getVarsRegistry().add(new Var.Builder("t2.718281828459045", "2")); 
		Locator.getInstance().getEngine().getVarsRegistry().add(new Var.Builder("t", (String) null));
		//Assert.assertEquals("t2.718281828459045e", tp.process("t2.718281828459045*2.718281828459045")); 
		//Assert.assertEquals("ee", tp.process("2.718281828459045*2.718281828459045")); 
		Assert.assertEquals("t×", tp.process("t*"));
		Assert.assertEquals("×t", tp.process("*t"));