User a719ee09dd
05-04-2011 15:03:21
Hello,
I wish I had the exact molar mass with more than two digits after the decimal point.
I used the "exactmass()" in Javascript in a html page with the applet MARVIN SKETCH.
<script type="text/javascript">
function envoyer(theForm) {
if (document.MSketch.isEmpty()) {
alert("erreur");
}
else {
theForm.mol.value=document.MSketch.getMol('mol');
theForm.massmol.value=document.MSketch.evaluateChemicalTerms('exactmass()');
theForm.formbrut.value=document.MSketch.evaluateChemicalTerms('formula');
theForm.submit();
}
}
</script>
I get the molar mass with only two digits after the decimal point.
How to have more digits after the decimal point in decimal?
Thank you for your reply.
ChemAxon e08c317633
11-04-2011 15:56:57
kingos wrote: |
I get the molar mass with only two digits after the decimal point.
How to have more digits after the decimal point in decimal?
|
Unfortunately in javascript it is not yet possible to set the number of decimal digits.
We have registred this feature request.
Zsolt
User 613c6cda4d
13-04-2011 15:10:10
Hi
To have more digits after the decimal point you should emphasize the command:
getMolFormula()
For your code that gives this transformation :
<script type="text/javascript">
function envoyer(theForm) {
if (document.MSketch.isEmpty()) {
alert("erreur");
}
else {
theForm.mol.value=document.MSketch.getMol('mol');
theForm.massmol.value=document.MSketch.evaluateChemicalTerms('exactmass()');
theForm.formbrut.value=document.MSketch.getMolFormula();
theForm.submit();
}
}
</script>
Best regards.
ChemAxon e08c317633
14-04-2011 15:25:30