Skip to content

Commit

Permalink
Merge pull request #82 from rpbouman/dev
Browse files Browse the repository at this point in the history
Maintenance
  • Loading branch information
rpbouman authored Apr 15, 2024
2 parents 0fa4f1a + 1ecb2fa commit 866dc41
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/DataSource/duckdb/DuckDbDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class DuckDbDataSource extends EventEmitter {
file.name,
file,
protocol
)
);
}

async destroy(){
Expand Down
4 changes: 2 additions & 2 deletions src/ExportUi/ExportUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ function downloadBlob(data, fileName, mimeType) {
}, 1000);
};

function downloadURL(data, fileName) {
function downloadURL(url, fileName) {
var a;
a = document.createElement('a');
a.href = data;
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.style = 'display: none';
Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ <h3 id="aboutDialogTitle">About Huey...</h3>
<ul>
<li>Huey version 0.0.3 - tiny ripple</li>
<li><a href="https://duckdb.org/" target="_duckdb" id="duckdbVersionLabel"></a></li>
<li><a href="https://www.jsdelivr.com/package/npm/@duckdb/duckdb-wasm?version=1.28.1-dev127.0" target="jsdelivr">DuckDB WASM 1.28.1-dev153.0</a></li>
<li><a href="https://www.jsdelivr.com/package/npm/@duckdb/duckdb-wasm?version=1.28.1-dev179.0" target="jsdelivr">DuckDB WASM 1.28.1-dev179.0</a></li>
<li><a href="https://tabler.io/icons" target="_tabler-icons">Tabler Icons v2.47.0</a></li>
<li><a href="https://github.com/rpbouman/huey/" target="_github">Huey Source on Github</a></li>
<li><a href="https://raw.githubusercontent.com/rpbouman/huey/dev/LICENSE" target="_github">License (MIT)</a></li>
Expand Down Expand Up @@ -1061,7 +1061,7 @@ <h1>Axis Caption</h1>

<script onload="resourceLoaded(this)" src="App/App.js"></script>
<script type="module">
import * as duckdb from 'https://cdn.jsdelivr.net/npm/@duckdb/[email protected]dev153.0/+esm';
import * as duckdb from 'https://cdn.jsdelivr.net/npm/@duckdb/[email protected]dev179.0/+esm';

const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
const bundle = await duckdb.selectBundle(JSDELIVR_BUNDLES);
Expand Down
20 changes: 18 additions & 2 deletions src/util/sql/SQLHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@ function createNumberFormatter(fractionDigits){
};

var intFormatter, decimalSeparator;
intFormatter = new Intl.NumberFormat(locales, Object.assign({maximumFractionDigits: 0}, options));
if (fractionDigits){
intFormatter = new Intl.NumberFormat(locales, Object.assign({maximumFractionDigits: 0}, options));
options.minimumFractionDigits = localeSettings.minimumFractionDigits;
options.maximumFractionDigits = localeSettings.maximumFractionDigits;
}
var formatter = new Intl.NumberFormat(locales, options);
var formatter;
try {
formatter = new Intl.NumberFormat(locales, options);
}
catch (e){
// if the settings from the options somehow lead to an invalid format, we log it,
// but we will recover by creating a formatter that at least works.
console.error(`Error creating number formatter using locales ${JSON.stringify(locales)} and options ${JSON.stringify(options)}`);
console.error(e);
locales = navigator.languages;
options = {};
if (!fractionDigits){
options.minimumFractionDigits = 0;
}
console.error(`Falling back to default ${JSON.stringify(locales)} and options ${JSON.stringify(options)}`);
formatter = new Intl.NumberFormat(locales, options);
}
if (fractionDigits){
decimalSeparator = (new Intl.NumberFormat(locales, {minFractionDigits: 1})).formatToParts(123.456).find(function(part){
return part.type === 'decimal';
Expand Down

0 comments on commit 866dc41

Please sign in to comment.