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
1 changed files with 9 additions and 0 deletions

View File

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