Add number class selection dropdown

This commit is contained in:
RunasSudo 2020-10-17 23:09:23 +11:00
parent 9092376998
commit b3e03c2f7b
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -7,6 +7,7 @@
<body>
<input type="file" id="bltFile">
<button onclick="clickBtn();">OK</button>
<select id="numbers"><option value="native" selected>Native</option><option value="rational">Rational</option></select>
<table id="result"></table>
@ -15,6 +16,14 @@
<script>
async function clickBtn() {
// Set numbers class
if (document.getElementById('numbers').value == 'native') {
py.pyRCV2.numbers.set_numclass(py.pyRCV2.numbers.Native);
}
if (document.getElementById('numbers').value == 'rational') {
py.pyRCV2.numbers.set_numclass(py.pyRCV2.numbers.Rational);
}
// Read BLT file
let bltFile = document.getElementById('bltFile').files[0];
let text = await bltFile.text();