문제

i need to build a calculator. The input is a textarea and the behavior is a little complex, it should be like on this video http://www.youtube.com/watch?v=tR5tyhPmawE , 0:00 - 0:30 part. But im a little confuse where to start, im building basic interface and input. Can you point me in the right directions, im just dont know how to manage multilines wise. Thank you.

도움이 되었습니까?

해결책

Here's something that will help you get started.

I quickly wrapped up a sample demo @ http://jsfiddle.net/3tCep/

you can view the source here: https://github.com/davidnorth/JsReckoner

다른 팁

Javascript already provides the functionality via eval. But you need to strip out any non-numeric chars and perform a currency type rounding on the operations.

If you want interactive operations, then look for a newline char with the onkeyup handler.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top