#Unit Converter

1 messages · Page 1 of 1 (latest)

glacial nexus
#

Unit converter

https://github.com/sadan4/plugin-unitConverter
Allows you to convert units to imperial or metric.

Click the button above the message to convert.

If you see any errors in conversion, or things you think should be converted, feel free to ping me.

Works with

  • feet and inches to meters and centimeters
  • Fahrenheit to Celsius
  • pounds and ounces to grams and kilograms
    Example:
#

@winged osprey do you have notifs on for this channel?

winged osprey
#

no

#

i was just focused in the forum

glacial nexus
#

ah

fiery socket
#

actual useful plugin

glacial nexus
wary lantern
#

@glacial nexus Here is a less thicc svg icon

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-5.0 -10.0 110.0 135.0">
    <path
        d="m50 16.668v-7.4609c0-1.875-2.25-2.7891-3.543-1.457l-11.664 11.625c-0.83594 0.83203-0.83594 2.125 0 2.957l11.625 11.625c1.332 1.293 3.582 0.375 3.582-1.5v-7.457c13.793 0 25 11.207 25 25 0 3.293-0.625 6.5-1.832 9.375-0.625 1.5-0.16797 3.207 0.95703 4.332 2.125 2.125 5.707 1.375 6.832-1.4141 1.543-3.793 2.375-7.9609 2.375-12.293 0-18.418-14.914-33.332-33.332-33.332zm0 58.332c-13.793 0-25-11.207-25-25 0-3.293 0.625-6.5 1.832-9.375 0.625-1.5 0.16797-3.207-0.95703-4.332-2.125-2.125-5.707-1.375-6.832 1.4141-1.543 3.793-2.375 7.9609-2.375 12.293 0 18.418 14.914 33.332 33.332 33.332v7.4609c0 1.875 2.25 2.7891 3.543 1.457l11.625-11.625c0.83203-0.83203 0.83203-2.125 0-2.957l-11.625-11.625c-1.293-1.293-3.543-0.375-3.543 1.5z" />
</svg>```
weak crane
glacial oar
#

i feel like speed (mph, kmh etc) should be added

glacial nexus
glacial oar
#

yes

#

but people use a variety of ways to say kmh

glacial nexus
glacial oar
#

some that come off the top of my head are: kmh, km/h, kmph, kph

#

there might be more but that's the most common ones

glacial nexus
glacial oar
#

works

#

i think
i hope

#

always good to test it out first though

glacial nexus
glacial oar
#

ah

glacial nexus
#

70 km/h

#

60 mph

#

@glacial oar

glacial nexus
glacial nexus
glacial oar
#

1 sec

glacial oar
#

works for me too

wary lantern
naive girder
#

maybe add an option to auto convert any messages that contain the regex for a measurement?

glacial nexus
#

How would you want it to be toggled

naive girder
#

just a setting probably

#

maybe have a setup similar to the translation plugin, with the chat bar button that can change settings, turn on auto conversion, etc. etc.

glacial nexus
#

I'll look into in, right now I want to get an inverter mode working

glacial nexus
#

5'6 and 200lbs

#

@hallow narwhal updated, pull for fix

hallow narwhal
#

thanks

glacial nexus
#

it was already a feature, my regex was just bad

hallow narwhal
#

lol

#

5'6

hallow narwhal
naive girder
#

lol

hallow narwhal
#

200lbs

#

pounds work

glacial nexus
#

It was set to work with something like 6'3" or 5'9''

#

That's how it is supposed to be written

hallow narwhal
glacial nexus
naive girder
#

uwu

hallow narwhal
glacial nexus
#

Are your units set to metric in settings

hallow narwhal
#

yes

glacial nexus
#

I'll take a look in a moment

hallow narwhal
#

oke

#

and just in case

fiery socket
#

i didnt know you could git pull inside a parent folder

#

lol

naive girder
#

can you?

#

i dont think you can

#

one sec

#

yea, you cant

glacial nexus
glacial nexus
#

git pull in the plugin dir

hallow narwhal
glacial nexus
hallow narwhal
glacial nexus
#

yea, you arent updated

#

git pull should have worked

#

can you run git remote -v

hallow narwhal
glacial nexus
# hallow narwhal

have you ever used git or github before
im not trying to be mean or rude

#

you just seem new

#

anyway, heres what you should do

#

then run this command

#

delete the plugin dir

#

(not the userplugin one, just unitConverter)

#

then run this command

hallow narwhal
glacial nexus
hallow narwhal
#

nope

#

git clone

glacial nexus
#

the fuck

#

remove the plugin dir and re-clone

hallow narwhal
#

will do

#

give a second im in game

#

wait

#

lmfao

#

i think i didnt get the .git folder the first time

hallow narwhal
#

now it works

#

thanks

fervent bramble
#

Goated plugin

fresh hinge
#

so fun fact: something like 2 miles doesnt work

#

@glacial nexus :)

glacial nexus
#

ill patch, thanks

fresh hinge
#

ping me when youre done

glacial nexus
#

@fresh hinge run git pull in the unit-converter folder

#

then rebuild

fresh hinge
#

thx

finite pelican
#

Inches don't work correctly. 6 inches is 15,24 cm, not 2.36cm. Also, '6 inch' prints out as '2.36cmch'

glacial nexus
#

6 inches

#

@finite pelican fixed

#

pull to update

finite pelican
#

thx chief

#

🫡

glacial nexus
finite pelican
#

Also, a couple of things i've noticed:

  • 200lbs prints out as 90.70kg but it's actually 90.718474kg (would round up to 90.72kg)
  • 60 miles prints out as 96.54 km, but should be 96.56 km

Already fixed this on my end by adding more precision to numbers:

poundWord: {
    regex: /(\d+(?:\.\d+)?) *(lbs?|pounds?)(?! ?\d)/ig,
    convert(...groups: string[]) {
        const kg = (parseFloat(groups[1]) * 0.45359237).toFixed(2);
        return `${kg}kg`;
    },
},
miles: {
    regex: /(\d+(?:\.\d+)?) ?(mi(?:les)?)/gm,
    convert(...groups) {
        const km = (parseFloat(groups[1]) * 1.609344).toFixed(2);
        return `${km}km`;
    },
},
finite pelican
#

Yeah, that would be nice tbh

glacial nexus
finite pelican
#

it's fine, too lazy to make a fork anyways bleh

forest kiln
#

Would you consider adding cups/gram conversion for baking? Erm

glacial nexus
#

Sorry

golden sphinx
#

are the units the plugin converts to not customisable?

forest kiln
golden sphinx
#

hm,,

#

perhaps in the settings you should be able to list any unit for each- type. volume, distance, weight, etc

glacial nexus
golden sphinx
#

nope

#

:)

glacial nexus
dim dew
#

does it only work for KG and C? and not the other way around?

#

atleast for me

#

199lbs, 6'4, 100m,53kg, 90inch, 1 feet, 12cm, 23C, 121F

glacial nexus
limber cargo
#

i just got here and i love the plugin but can it work when inches are writen like 6" to cm?

glacial nexus
#

let me know if it doesnt

#

cant be bothered to check rn

#

6"

#

6''

#

6'2''

#

6'

#

6''

#

6"

fresh hinge
#

which currencies are supported and is future support for more planned? i noticed romanian currency (e.g. "Ron", "Lei", "Bani") not being supported (yet)

#

examples:
69 Ron
420 Lei
333 Bani

(couldnt think of another funny number for the last one. sincere apologies)

glacial nexus
#

that would need an external api

#

which i will not do/merge

#

+too many currencies / symbols

#

is $ a usd, cad, or aud

#

things like that

fresh hinge
#

ah yeah thats fair

finite cliff
#

Would you be interested in making it work like a popup? I saw some other unofficial plugins which do that and I think that'd be great

#

(That is, when you hover over the unit, it will give you the conversion)

#

<t:1577873460>

#

By popup I mean a hover-over one, like timestamps do

#

I think that'd be amazing

#

I don't know if I can link to it here, but the plugin I saw do that is toneIndicators from vencor​dp​lus

glacial nexus
#

maybe

#

@finite cliff link the other plugin that does it