This is what I was looking for, but if it slows down the page, I'll try to implement a formula first.This was the reason I dumped the formula for doing the text abstraction and switched to AppScript. There's a lot more flexibility there at the cost of speed. It doesn't look like you can see the AppScript in the copy I shared, but it does stuff like this:
Code:/* Format Cap values to match Xuf, Xpf, Xn, XnY, X.Yuf */ function formatCapValue(value) { if (value.map) { return value.map(formatCapValue); } else { // These are all okay values if (value.match(/^(\d+u[fF]|\d+p[fF]|\d+n\d*|\d+.\d+u[fF])$/)) { return value; } else { // Xu -> Xuf or Xp -> Xpf if (value.endsWith("u") || value.endsWith("p")) { return value + "F"; } let match = value.match(/(\d+)\.(\d+)n[fF]?/); if (match) { return match[1] + "n" + match[2]; } // Xnf -> Xn if (value.match(/\d+n[fF]$/)) { return value.slice(0, -1); } // XuY -> X.Yuf match = value.match(/(\d+)u(\d+)/); if (match) { return match[1] + "." + match[2] + "uF" } // We can't figure it out throw("Could not format value: " + value); } } }
There are formatting functions for each of the major part types and which one is used depends on which type of part is selected. There's probably ways to be more efficient by I was in proof of concept mode at the time, and I've been too busy to revisit it.
Robert
It should be possible.
If it has a P, it searches for pf, if it has u, it searches for uf, for pots, if it has a, b or c, it searches through the appropriate type. I think it's doable anyways...