[Question]
  [
[Resistors](http://en.wikipedia.org/wiki/Resistor) commonly have [color coded bands](http://en.wikipedia.org/wiki/Electronic_color_code#Resistor_color-coding) that are used to identify their [resistance](http://en.wikipedia.org/wiki/Electrical_resistance_and_conductance) in [Ohms](http://en.wikipedia.org/wiki/Ohm). In this challenge we'll only consider the normal 4-band, tan, axial-lead resistors. We'll express them as:
```
xyzt
```
Where `x` is the first band for the first significant figure, `y` is the second band for the second significant figure, `z` the third band for the multiplier, and `t` is the fourth band for the [tolerance](http://en.wikipedia.org/wiki/Engineering_tolerance).
Each of `xyzt` represents a letter that abbreviates the color of the band:
```
K = Black
N = Brown
R = Red
O = Orange
Y = Yellow
G = Green
B = Blue
V = Violet
A = Gray
W = White
g = Gold
s = Silver
_ = None
```
So, for example, `NKOg` is some particular resistor.
The resistance can be calculated with the help of this table:
[![Resistor color code table](https://i.stack.imgur.com/0mIY8.png)](http://en.wikipedia.org/wiki/Electronic_color_code#Resistor_color-coding)
As the table suggests:
* `x` and `y` can be any letters except `g`, `s`, and `_`.
* `z` can be anything except `_`.
* We'll restrict `t` to only be `g`, `s`, or `_`.
([Here's a handy resistance calculator that deals with exact same set of resistors we are.](http://www.dannyg.com/examples/res2/resistor.htm))
The resistance is `10 * x + y` times the `z` multiplier, to a tolerance of the `t` percentage.
> 
> For example, to calculate the resistance of `NKOg`, we see that:
> 
> 
> 1. `N` means Brown for 1.
> 2. `K` means Black for 0.
> 3. `O` means Orange for 103.
> 4. `g` means Gold for ±5%.
> 
> 
> So the resistance is `(10*1 + 0)*10^3` → `10000 Ω ±5%`.
> 
> 
> 
# Challenge
Write a program or function that takes in a 4 character string of the form `xyzt` and prints or returns the resistance in the form `[resistance] Ω ±[tolerance]%`.
* **The resistor may be "upside-down", i.e. in the reverse order `tzyx`. For example, both `NKOg` and `gOKN` should produce `10000 Ω ±5%`.**
* The resistance is always in plain ohms, never kilohms, megohms, etc.
* [`Ω`](http://www.fileformat.info/info/unicode/char/03a9/index.htm) may be replaced with `ohms`, e.g. `10000 ohms ±5%`.
* [`±`](http://www.fileformat.info/info/unicode/char/b1/index.htm) may be replaced with `+/-`, e.g. `10000 Ω +/-5%`.
* Having trailing zeros to the right of a decimal point is fine. (e.g. `10000.0 Ω +/-5%`)
* You can assume input is always valid (`x` and `y` never `gs_`; `z` never `_`; `t` only `gs_`).
* All 10×10×12×3 = 3600 possible resistors (2×3600 possible inputs) need to be supported even if some color band combinations aren't produced in real life.
**The shortest code in bytes wins.**
# Examples
1. `gOKN` → `10000 ohms +/-5%`
2. `KKR_` → `0 Ω +/-20%`
3. `ggKN` → `1 ohms ±5%`
4. `ggGO` → `3.5 Ω ±5%`
5. `ssGO` → `0.350 Ω ±10%`
6. `GOOs` → `53000 ohms +/-10%`
7. `YAK_` → `48.0 ohms +/-20%`
8. `_WAV` → `78000000000 Ω ±20%`
9. `gBBB` → `66000000.000 ohms ±5%`
10. `_RYR` → `2400.00 ohms ±20%`
[Iff](http://en.wikipedia.org/wiki/If_and_only_if) you enjoy my challenges, consider checking out [Block Building Bot Flocks!](https://codegolf.stackexchange.com/q/50690/26997)
  
[Answer]
# CJam, ~~59~~ ~~58~~ ~~56~~ 50 bytes
```
r_W%e>"sgKNROYGBVAW"f#2f-~A*+A@#*" Ω ±"@[KA5]='%
```
Try it online in the [CJam interpreter](http://cjam.aditsu.net/#code=r_W%25e%3E%22sgKNROYGBVAW%22f%232f-~A*%2BA%40%23*%22%20%CE%A9%20%C2%B1%22%40%5BKA5%5D%3D'%25&input=ggGO).
[Answer]
# CJam, ~~53~~ ~~51~~ 50 bytes
```
" Ω ±"l_W%e<)iB%5*F-'%@"gKNROYGBVAW"f#:(2/'e*s~o
```
[Try it online](http://cjam.aditsu.net/#code=%22%20%CE%A9%20%C2%B1%22l_W%25e%3C%29iB%255*F-'%25%40%22gKNROYGBVAW%22f%23%3A%282%2F'e*s~o&input=_RYR).
*(Thanks to @user23013 for a byte)*
---
I started out in Python, but
```
eval("%d%de%d"%tuple("gKNROYGBVAW".find(x)-1for x in L))
```
was too expensive...
[Answer]
## Python 3, ~~130~~ 114 bytes
```
def f(v):
 a,b,c,d=["_sgKNROYGBVAW".index(x)-3for x in v[::(1,-1)[v[0]in'sg_']]]
 return "%s Ω ±%s%%"%((10*a+b)*10**c,2.5*2**-d)
```
*edit:* @Sp3000 points out that the ordering can be better detected with `min(v,v[::-1])` rather than `v[::(1,-1)[v[0]in'sg_']]` (saving 10 bytes), not check the index of `_` and remove some unnecessary whitespace.
```
def f(v):a,b,c,d=["sgKNROYGBVAW".find(x)-2for x in min(v,v[::-1])];return"%s Ω ±%s%%"%((10*a+b)*10**c,2.5*2**-d)
```
[Answer]
# Perl, 93 bytes
```
#!perl -lp
ord>90and$_=reverse;s/./-3+index zsgKNROYGBVAW,$&/ge;$_=s/..\K/e/*$_." Ω ±"./.$/*5*$&."%"
```
[Answer]
# Haskell, ~~135 132~~ 130 bytes
```
r y|y<"["=p[k|j<-y,(c,k)<-zip"_ sgKNROYGBVAW"[-4..],c==j]
r y=r.reverse$y
p[a,b,c,d]=show((a*10+b)*10**c)++" Ω ±"++show(-5*d)++"%"
```
**Explanation:**
```
r y|y<"["=            If first letter of argument is a capital
p[..]                 Call p on the list created
[k|                   Make a list of all k
   j<-y               Draw character j from input
       ,(c,k)<-       With (c,k) being a pair from
               zip    A list of pairs of corresponding elements from the lists:
"_ sgKNROYGBVAW"       The space at 2nd position is to match '_' with -4, but 's' with -2
[-4..]                 An infinite list starting at -4
,c==j]                Only use element k if j equals the character c
r y=r.reverse$y       If first call fails, call again with reversed argument.
p[a,b,c,d]=           Assign the first four elements of the argument to a,b,c,d respectively.
show                  Turn (number) into string
10**c                 10 to the power of c
++                    Concatenate strings
-5*d                  This works for the tolerance because '_' makes d=-4
```
*Thanks to nimi, I shaved off another 2 bytes.*
]