Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set unitSystem conversion #1282

Open
pvandriessche opened this issue Oct 16, 2018 · 3 comments
Open

Set unitSystem conversion #1282

pvandriessche opened this issue Oct 16, 2018 · 3 comments
Assignees

Comments

@pvandriessche
Copy link

pvandriessche commented Oct 16, 2018

I'm trying to set a unitSystem for a Unit that was created in "Inch", when I call setUnitSystem('si') the unit system is corretly changed.
However when calling the format() the unit is still represented in Inch.
Is there a way to solve this?

This is the code

    var measure = math.unit("2 in")
    console.log(measure.formatUnits());
    //"in"
    measure.constructor.setUnitSystem("si");
    console.log("unit system :" + measure.constructor.getUnitSystem());
    // "unit system: si"
    console.log(measure.formatUnits());
    // "in" => should be "m"?

Thanks in advance!

@ericman314 ericman314 self-assigned this Oct 17, 2018
@josdejong
Copy link
Owner

@ericman314 you assigned yourself to this issue, did you have a look at it?

@ericman314
Copy link
Collaborator

Sorry, I forgot about this. Perhaps before trying a fix for this, we should look more closely at #1300 and find a good solution there that will address this and other related issues.

@josdejong
Copy link
Owner

Yes I think so. There are also some other ideas for improvements of units floating around here and there (#1305, #1306, #1041, maybe others). Can be helpful to keep these in mind too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants