나는 계산기를 사용할 시스템을 만들고 있지만 주어진 시간에 사용자가 단어를 클릭해야하며 해당 단어의 값이 필요합니다 (예 : 20).단어를 숫자로 변환하는 방법
car = 20;
2 + (car + 1);
이 공식의 결과 23
이 단어 및 값
누구나 자바 스크립트에서이 작업을 수행하는 방법을 알고 데이터베이스에서 온다 : 어떻게 작동하는지 수학 공식의 예를 보려면? 오류를 교체 부분 일치 단어를 무시에 대한
function addChar(input, character) {
if (input.value == null || input.value == "0"){
input.value = character;
}
else{
input.value += character;
}
}
function cos(form) {
form.display.value = Math.cos(form.display.value);
}
function sin(form) {
form.display.value = Math.sin(form.display.value);
}
function tan(form) {
form.display.value = Math.tan(form.display.value);
}
function sqrt(form) {
form.display.value = Math.sqrt(form.display.value);
}
function ln(form) {
form.display.value = Math.log(form.display.value);
}
function exp(form) {
form.display.value = Math.exp(form.display.value);
}
function sqrt(form) {
form.display.value = Math.sqrt(form.display.value);
}
function deleteChar(input) {
input.value = input.value.substring(0, input.value.length - 1)
}
function changeSign(input) {
if (input.value.substring(0, 1) == "-"){
input.value = input.value.substring(1, input.value.length);
}
else{
input.value = "-" + input.value
}
}
function compute(form) {
form.display.value = eval(form.display.value)
}
function square(form) {
form.display.value = eval(form.display.value) *
eval(form.display.value)
}
PHP와 관련이 있습니까? 아니면 그냥 자바 스크립트? – BlitZ
귀하의 계산기는 어떤 언어로 작성 되었습니까? HTML? –
개체를 사용 하시겠습니까? 'dict = { 'car': 20}'그때'dict [ 'car'] +1은'21' –