[{"data":1,"prerenderedAt":1336},["ShallowReactive",2],{"page-\u002Fcore\u002Fguides\u002Funit-conversion":3,"navigation":957},{"collection":4,"page":5},"docs_en",{"id":6,"title":7,"body":8,"description":949,"extension":950,"meta":951,"navigation":90,"path":952,"rawbody":953,"seo":954,"stem":955,"__hash__":956},"docs_en\u002Fcore\u002F2.guides\u002F3.unit-conversion.md","Unit conversion",{"type":9,"value":10,"toc":942},"minimark",[11,30,152,166,171,370,378,382,385,525,572,576,610,613,759,774,778,786,927,938],[12,13,14,15,19,20,25,26,29],"p",{},"A ",[16,17,18],"code",{},".well"," file always stores canonical SI units: meters, millimeters, m³\u002Fh, kW, m³ (",[21,22,24],"a",{"href":23},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#units","Units","). People read and type inches, feet, gallons and horsepower. ",[16,27,28],{},"@welldot\u002Fcore"," provides the conversions so that every program converts the same way: to SI when writing, from SI when displaying.",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { inchesToMm, metersToFeet, slotNumberToMm } from '@welldot\u002Fcore';\n\ninchesToMm(10); \u002F\u002F 254, for a 10 in borehole\nslotNumberToMm(20); \u002F\u002F 0.508, a slot-20 screen\nmetersToFeet(60); \u002F\u002F 196.85…\n","ts","",[16,38,39,85,92,116,134],{"__ignoreMap":36},[40,41,44,48,52,56,59,62,64,67,70,73,76,79,82],"span",{"class":42,"line":43},"line",1,[40,45,47],{"class":46},"s7zQu","import",[40,49,51],{"class":50},"sMK4o"," {",[40,53,55],{"class":54},"sTEyZ"," inchesToMm",[40,57,58],{"class":50},",",[40,60,61],{"class":54}," metersToFeet",[40,63,58],{"class":50},[40,65,66],{"class":54}," slotNumberToMm",[40,68,69],{"class":50}," }",[40,71,72],{"class":46}," from",[40,74,75],{"class":50}," '",[40,77,28],{"class":78},"sfazB",[40,80,81],{"class":50},"'",[40,83,84],{"class":50},";\n",[40,86,88],{"class":42,"line":87},2,[40,89,91],{"emptyLinePlaceholder":90},true,"\n",[40,93,95,99,102,106,109,112],{"class":42,"line":94},3,[40,96,98],{"class":97},"s2Zo4","inchesToMm",[40,100,101],{"class":54},"(",[40,103,105],{"class":104},"sbssI","10",[40,107,108],{"class":54},")",[40,110,111],{"class":50},";",[40,113,115],{"class":114},"sHwdD"," \u002F\u002F 254, for a 10 in borehole\n",[40,117,119,122,124,127,129,131],{"class":42,"line":118},4,[40,120,121],{"class":97},"slotNumberToMm",[40,123,101],{"class":54},[40,125,126],{"class":104},"20",[40,128,108],{"class":54},[40,130,111],{"class":50},[40,132,133],{"class":114}," \u002F\u002F 0.508, a slot-20 screen\n",[40,135,137,140,142,145,147,149],{"class":42,"line":136},5,[40,138,139],{"class":97},"metersToFeet",[40,141,101],{"class":54},[40,143,144],{"class":104},"60",[40,146,108],{"class":54},[40,148,111],{"class":50},[40,150,151],{"class":114}," \u002F\u002F 196.85…\n",[12,153,154,155,158,159,165],{},"Results are not rounded; format them for display (for example with ",[16,156,157],{},"formatNumber"," from ",[21,160,162],{"href":161},"\u002Futils\u002Fguides\u002Fformatting",[16,163,164],{},"@welldot\u002Futils",").",[167,168,170],"h2",{"id":169},"the-helpers","The helpers",[172,173,174,187],"table",{},[175,176,177],"thead",{},[178,179,180,184],"tr",{},[181,182,183],"th",{},"Quantity",[181,185,186],{},"Functions",[188,189,190,204,216,228,247,266,291,304,317,330,343,357],"tbody",{},[178,191,192,196],{},[193,194,195],"td",{},"Length",[193,197,198,200,201],{},[16,199,139],{},", ",[16,202,203],{},"feetToMeters",[178,205,206,209],{},[193,207,208],{},"Diameter",[193,210,211,200,214],{},[16,212,213],{},"mmToInches",[16,215,98],{},[178,217,218,221],{},[193,219,220],{},"Screen slot",[193,222,223,200,225],{},[16,224,121],{},[16,226,227],{},"mmToSlotNumber",[178,229,230,233],{},[193,231,232],{},"Flow",[193,234,235,200,238,200,241,200,244],{},[16,236,237],{},"cubicMeterPerHourToLitersPerSecond",[16,239,240],{},"litersPerSecondToCubicMeterPerHour",[16,242,243],{},"cubicMeterPerHourToUsGallonsPerMinute",[16,245,246],{},"usGallonsPerMinuteToCubicMeterPerHour",[178,248,249,252],{},[193,250,251],{},"Power",[193,253,254,200,257,200,260,200,263],{},[16,255,256],{},"cvToKilowatts",[16,258,259],{},"kilowattsToCv",[16,261,262],{},"hpToKilowatts",[16,264,265],{},"kilowattsToHp",[178,267,268,271],{},[193,269,270],{},"Volume",[193,272,273,200,276,200,279,200,282,200,285,200,288],{},[16,274,275],{},"litersToCubicMeters",[16,277,278],{},"cubicMetersToLiters",[16,280,281],{},"cubicMetersToCubicFeet",[16,283,284],{},"cubicFeetToCubicMeters",[16,286,287],{},"cubicMetersToUsGallons",[16,289,290],{},"usGallonsToCubicMeters",[178,292,293,296],{},[193,294,295],{},"Time",[193,297,298,200,301],{},[16,299,300],{},"minutesToHours",[16,302,303],{},"hoursToMinutes",[178,305,306,309],{},[193,307,308],{},"Pressure",[193,310,311,200,314],{},[16,312,313],{},"kilopascalToPsi",[16,315,316],{},"psiToKilopascal",[178,318,319,322],{},[193,320,321],{},"Transmissivity",[193,323,324,200,327],{},[16,325,326],{},"squareMeterPerSecondToSquareMeterPerDay",[16,328,329],{},"squareMeterPerDayToSquareMeterPerSecond",[178,331,332,335],{},[193,333,334],{},"Coordinates",[193,336,337,200,340],{},[16,338,339],{},"decimalDegreesToDms",[16,341,342],{},"dmsToDecimalDegrees",[178,344,345,348],{},[193,346,347],{},"Concentration",[193,349,350,200,353,356],{},[16,351,352],{},"concentrationToCanonical",[16,354,355],{},"concentrationFromCanonical"," (mg\u002FL, µg\u002FL, ng\u002FL, g\u002FL)",[178,358,359,362],{},[193,360,361],{},"Conductivity",[193,363,364,200,367],{},[16,365,366],{},"milliSiemensPerMeterToMicroSiemensPerCm",[16,368,369],{},"milliSiemensPerCmToMicroSiemensPerCm",[12,371,372,373,377],{},"Every function has a page in the ",[21,374,376],{"href":375},"\u002Fcore\u002Fapi","API reference",".",[167,379,381],{"id":380},"converting-by-a-users-preference","Converting by a user's preference",[12,383,384],{},"For flow, power and volume there are paired helpers that take the display unit as an argument. They fit a settings screen where the user picks units once:",[31,386,388],{"className":33,"code":387,"language":35,"meta":36,"style":36},"import {\n  flowFromCanonical,\n  flowToCanonical,\n  type FlowUnits,\n} from '@welldot\u002Fcore';\n\nconst unit: FlowUnits = 'L\u002Fs'; \u002F\u002F 'm3\u002Fh' | 'L\u002Fs' | 'gpm'\n\nflowFromCanonical(36, unit); \u002F\u002F 10, to show a stored 36 m³\u002Fh\nflowToCanonical(10, 'gpm'); \u002F\u002F 2.27…, to store a typed 10 gpm\n",[16,389,390,397,405,412,422,437,442,473,478,499],{"__ignoreMap":36},[40,391,392,394],{"class":42,"line":43},[40,393,47],{"class":46},[40,395,396],{"class":50}," {\n",[40,398,399,402],{"class":42,"line":87},[40,400,401],{"class":54},"  flowFromCanonical",[40,403,404],{"class":50},",\n",[40,406,407,410],{"class":42,"line":94},[40,408,409],{"class":54},"  flowToCanonical",[40,411,404],{"class":50},[40,413,414,417,420],{"class":42,"line":118},[40,415,416],{"class":46},"  type",[40,418,419],{"class":54}," FlowUnits",[40,421,404],{"class":50},[40,423,424,427,429,431,433,435],{"class":42,"line":136},[40,425,426],{"class":50},"}",[40,428,72],{"class":46},[40,430,75],{"class":50},[40,432,28],{"class":78},[40,434,81],{"class":50},[40,436,84],{"class":50},[40,438,440],{"class":42,"line":439},6,[40,441,91],{"emptyLinePlaceholder":90},[40,443,445,449,452,455,458,461,463,466,468,470],{"class":42,"line":444},7,[40,446,448],{"class":447},"spNyl","const",[40,450,451],{"class":54}," unit",[40,453,454],{"class":50},":",[40,456,419],{"class":457},"sBMFI",[40,459,460],{"class":50}," =",[40,462,75],{"class":50},[40,464,465],{"class":78},"L\u002Fs",[40,467,81],{"class":50},[40,469,111],{"class":50},[40,471,472],{"class":114}," \u002F\u002F 'm3\u002Fh' | 'L\u002Fs' | 'gpm'\n",[40,474,476],{"class":42,"line":475},8,[40,477,91],{"emptyLinePlaceholder":90},[40,479,481,484,486,489,491,494,496],{"class":42,"line":480},9,[40,482,483],{"class":97},"flowFromCanonical",[40,485,101],{"class":54},[40,487,488],{"class":104},"36",[40,490,58],{"class":50},[40,492,493],{"class":54}," unit)",[40,495,111],{"class":50},[40,497,498],{"class":114}," \u002F\u002F 10, to show a stored 36 m³\u002Fh\n",[40,500,502,505,507,509,511,513,516,518,520,522],{"class":42,"line":501},10,[40,503,504],{"class":97},"flowToCanonical",[40,506,101],{"class":54},[40,508,105],{"class":104},[40,510,58],{"class":50},[40,512,75],{"class":50},[40,514,515],{"class":78},"gpm",[40,517,81],{"class":50},[40,519,108],{"class":54},[40,521,111],{"class":50},[40,523,524],{"class":114}," \u002F\u002F 2.27…, to store a typed 10 gpm\n",[12,526,527,530,531,534,535,538,539,530,542,534,545,548,549,551,552,200,555,200,558,200,561,200,564,567,568,571],{},[16,528,529],{},"powerFromCanonical"," \u002F ",[16,532,533],{},"powerToCanonical"," take ",[16,536,537],{},"'kW' | 'cv' | 'hp'",", and ",[16,540,541],{},"volumeFromCanonical",[16,543,544],{},"volumeToCanonical",[16,546,547],{},"'m3' | 'L' | 'ft3' | 'gal'"," (US gallon). The ",[16,550,24],{}," type groups the preferences (",[16,553,554],{},"length",[16,556,557],{},"diameter",[16,559,560],{},"flow",[16,562,563],{},"power",[16,565,566],{},"volume",") and is what ",[16,569,570],{},"@welldot\u002Frender"," accepts.",[167,573,575],{"id":574},"diameters-and-slots-the-traps","Diameters and slots: the traps",[577,578,579,596],"ul",{},[580,581,582,586,587,590,591,595],"li",{},[583,584,585],"strong",{},"Nominal sizes are not diameters."," ",[16,588,589],{},"inchesToMm(6)"," is 152.4 mm, but 6 in steel pipe has an outer diameter of 168.3 mm, and the file stores the real outer diameter (",[21,592,594],{"href":593},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#diameter-and-the-as-built-convention","as-built convention","). Use the conversion for boreholes and true measurements; map trade sizes to real diameters in your input form.",[580,597,598,601,602,605,606,165],{},[583,599,600],{},"Slot numbers"," are thousandths of an inch: ",[16,603,604],{},"slotNumberToMm(20)"," is 0.508 mm (",[21,607,609],{"href":608},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#screen-slot","screen slot",[167,611,334],{"id":612},"coordinates",[31,614,616],{"className":33,"code":615,"language":35,"meta":36,"style":36},"import { decimalDegreesToDms, dmsToDecimalDegrees } from '@welldot\u002Fcore';\n\ndecimalDegreesToDms(-1.4558, 'lat');\n\u002F\u002F { degrees: 1, minutes: 27, seconds: 20.88, direction: 'S' }\n\ndmsToDecimalDegrees({\n  degrees: 1,\n  minutes: 27,\n  seconds: 20.88,\n  direction: 'S',\n});\n\u002F\u002F -1.4558\n",[16,617,618,644,648,673,678,682,691,704,716,728,744,753],{"__ignoreMap":36},[40,619,620,622,624,627,629,632,634,636,638,640,642],{"class":42,"line":43},[40,621,47],{"class":46},[40,623,51],{"class":50},[40,625,626],{"class":54}," decimalDegreesToDms",[40,628,58],{"class":50},[40,630,631],{"class":54}," dmsToDecimalDegrees",[40,633,69],{"class":50},[40,635,72],{"class":46},[40,637,75],{"class":50},[40,639,28],{"class":78},[40,641,81],{"class":50},[40,643,84],{"class":50},[40,645,646],{"class":42,"line":87},[40,647,91],{"emptyLinePlaceholder":90},[40,649,650,652,654,657,660,662,664,667,669,671],{"class":42,"line":94},[40,651,339],{"class":97},[40,653,101],{"class":54},[40,655,656],{"class":50},"-",[40,658,659],{"class":104},"1.4558",[40,661,58],{"class":50},[40,663,75],{"class":50},[40,665,666],{"class":78},"lat",[40,668,81],{"class":50},[40,670,108],{"class":54},[40,672,84],{"class":50},[40,674,675],{"class":42,"line":118},[40,676,677],{"class":114},"\u002F\u002F { degrees: 1, minutes: 27, seconds: 20.88, direction: 'S' }\n",[40,679,680],{"class":42,"line":136},[40,681,91],{"emptyLinePlaceholder":90},[40,683,684,686,688],{"class":42,"line":439},[40,685,342],{"class":97},[40,687,101],{"class":54},[40,689,690],{"class":50},"{\n",[40,692,693,697,699,702],{"class":42,"line":444},[40,694,696],{"class":695},"swJcz","  degrees",[40,698,454],{"class":50},[40,700,701],{"class":104}," 1",[40,703,404],{"class":50},[40,705,706,709,711,714],{"class":42,"line":475},[40,707,708],{"class":695},"  minutes",[40,710,454],{"class":50},[40,712,713],{"class":104}," 27",[40,715,404],{"class":50},[40,717,718,721,723,726],{"class":42,"line":480},[40,719,720],{"class":695},"  seconds",[40,722,454],{"class":50},[40,724,725],{"class":104}," 20.88",[40,727,404],{"class":50},[40,729,730,733,735,737,740,742],{"class":42,"line":501},[40,731,732],{"class":695},"  direction",[40,734,454],{"class":50},[40,736,75],{"class":50},[40,738,739],{"class":78},"S",[40,741,81],{"class":50},[40,743,404],{"class":50},[40,745,747,749,751],{"class":42,"line":746},11,[40,748,426],{"class":50},[40,750,108],{"class":54},[40,752,84],{"class":50},[40,754,756],{"class":42,"line":755},12,[40,757,758],{"class":114},"\u002F\u002F -1.4558\n",[12,760,761,762,765,766,769,770,165],{},"Projected coordinates (UTM) are out of scope: convert them with a projection library such as ",[16,763,764],{},"proj4"," before writing ",[16,767,768],{},"location"," (",[21,771,773],{"href":772},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#crs-scope","CRS scope",[167,775,777],{"id":776},"laboratory-reports","Laboratory reports",[12,779,780,781,785],{},"Lab reports use many unit spellings. These helpers map them onto the file's conventions (",[21,782,784],{"href":783},"\u002Fformat\u002Fspec\u002Fv2\u002Fwater-quality#units","water quality units","):",[31,787,789],{"className":33,"code":788,"language":35,"meta":36,"style":36},"import {\n  concentrationToCanonical,\n  expandedToStandardUncertainty,\n  normalizeColorUnit,\n  turbidityCodeForUnit,\n} from '@welldot\u002Fcore';\n\nconcentrationToCanonical(50, 'ug\u002FL'); \u002F\u002F 0.05 mg\u002FL\nturbidityCodeForUnit('NTU'); \u002F\u002F 'turbidity_ntu', the parameter code to use\nnormalizeColorUnit('mg Pt-Co\u002FL'); \u002F\u002F 'uH'\nexpandedToStandardUncertainty(0.04); \u002F\u002F 0.02, U \u002F k with k = 2, for value_precision\n",[16,790,791,797,804,811,818,825,839,843,868,889,910],{"__ignoreMap":36},[40,792,793,795],{"class":42,"line":43},[40,794,47],{"class":46},[40,796,396],{"class":50},[40,798,799,802],{"class":42,"line":87},[40,800,801],{"class":54},"  concentrationToCanonical",[40,803,404],{"class":50},[40,805,806,809],{"class":42,"line":94},[40,807,808],{"class":54},"  expandedToStandardUncertainty",[40,810,404],{"class":50},[40,812,813,816],{"class":42,"line":118},[40,814,815],{"class":54},"  normalizeColorUnit",[40,817,404],{"class":50},[40,819,820,823],{"class":42,"line":136},[40,821,822],{"class":54},"  turbidityCodeForUnit",[40,824,404],{"class":50},[40,826,827,829,831,833,835,837],{"class":42,"line":439},[40,828,426],{"class":50},[40,830,72],{"class":46},[40,832,75],{"class":50},[40,834,28],{"class":78},[40,836,81],{"class":50},[40,838,84],{"class":50},[40,840,841],{"class":42,"line":444},[40,842,91],{"emptyLinePlaceholder":90},[40,844,845,847,849,852,854,856,859,861,863,865],{"class":42,"line":475},[40,846,352],{"class":97},[40,848,101],{"class":54},[40,850,851],{"class":104},"50",[40,853,58],{"class":50},[40,855,75],{"class":50},[40,857,858],{"class":78},"ug\u002FL",[40,860,81],{"class":50},[40,862,108],{"class":54},[40,864,111],{"class":50},[40,866,867],{"class":114}," \u002F\u002F 0.05 mg\u002FL\n",[40,869,870,873,875,877,880,882,884,886],{"class":42,"line":480},[40,871,872],{"class":97},"turbidityCodeForUnit",[40,874,101],{"class":54},[40,876,81],{"class":50},[40,878,879],{"class":78},"NTU",[40,881,81],{"class":50},[40,883,108],{"class":54},[40,885,111],{"class":50},[40,887,888],{"class":114}," \u002F\u002F 'turbidity_ntu', the parameter code to use\n",[40,890,891,894,896,898,901,903,905,907],{"class":42,"line":501},[40,892,893],{"class":97},"normalizeColorUnit",[40,895,101],{"class":54},[40,897,81],{"class":50},[40,899,900],{"class":78},"mg Pt-Co\u002FL",[40,902,81],{"class":50},[40,904,108],{"class":54},[40,906,111],{"class":50},[40,908,909],{"class":114}," \u002F\u002F 'uH'\n",[40,911,912,915,917,920,922,924],{"class":42,"line":746},[40,913,914],{"class":97},"expandedToStandardUncertainty",[40,916,101],{"class":54},[40,918,919],{"class":104},"0.04",[40,921,108],{"class":54},[40,923,111],{"class":50},[40,925,926],{"class":114}," \u002F\u002F 0.02, U \u002F k with k = 2, for value_precision\n",[12,928,929,930,933,934,165],{},"The last one implements the spec's rule that ",[16,931,932],{},"value_precision"," is one standard deviation, not the expanded uncertainty (",[21,935,937],{"href":936},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#precision-and-uncertainty","precision",[939,940,941],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}",{"title":36,"searchDepth":87,"depth":87,"links":943},[944,945,946,947,948],{"id":169,"depth":87,"text":170},{"id":380,"depth":87,"text":381},{"id":574,"depth":87,"text":575},{"id":612,"depth":87,"text":334},{"id":776,"depth":87,"text":777},"Convert between the canonical SI units of .well files and the units people read and type, with the conversion helpers of @welldot\u002Fcore.","md",{},"\u002Fcore\u002Fguides\u002Funit-conversion","---\ntitle: Unit conversion\ndescription: Convert between the canonical SI units of .well files and the units people read and type, with the conversion helpers of @welldot\u002Fcore.\n---\n\nA `.well` file always stores canonical SI units: meters, millimeters, m³\u002Fh, kW, m³ ([Units](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#units)). People read and type inches, feet, gallons and horsepower. `@welldot\u002Fcore` provides the conversions so that every program converts the same way: to SI when writing, from SI when displaying.\n\n```ts\nimport { inchesToMm, metersToFeet, slotNumberToMm } from '@welldot\u002Fcore';\n\ninchesToMm(10); \u002F\u002F 254, for a 10 in borehole\nslotNumberToMm(20); \u002F\u002F 0.508, a slot-20 screen\nmetersToFeet(60); \u002F\u002F 196.85…\n```\n\nResults are not rounded; format them for display (for example with `formatNumber` from [`@welldot\u002Futils`](\u002Futils\u002Fguides\u002Fformatting)).\n\n## The helpers\n\n| Quantity       | Functions                                                                                                                                                    |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| Length         | `metersToFeet`, `feetToMeters`                                                                                                                               |\n| Diameter       | `mmToInches`, `inchesToMm`                                                                                                                                   |\n| Screen slot    | `slotNumberToMm`, `mmToSlotNumber`                                                                                                                           |\n| Flow           | `cubicMeterPerHourToLitersPerSecond`, `litersPerSecondToCubicMeterPerHour`, `cubicMeterPerHourToUsGallonsPerMinute`, `usGallonsPerMinuteToCubicMeterPerHour` |\n| Power          | `cvToKilowatts`, `kilowattsToCv`, `hpToKilowatts`, `kilowattsToHp`                                                                                           |\n| Volume         | `litersToCubicMeters`, `cubicMetersToLiters`, `cubicMetersToCubicFeet`, `cubicFeetToCubicMeters`, `cubicMetersToUsGallons`, `usGallonsToCubicMeters`         |\n| Time           | `minutesToHours`, `hoursToMinutes`                                                                                                                           |\n| Pressure       | `kilopascalToPsi`, `psiToKilopascal`                                                                                                                         |\n| Transmissivity | `squareMeterPerSecondToSquareMeterPerDay`, `squareMeterPerDayToSquareMeterPerSecond`                                                                         |\n| Coordinates    | `decimalDegreesToDms`, `dmsToDecimalDegrees`                                                                                                                 |\n| Concentration  | `concentrationToCanonical`, `concentrationFromCanonical` (mg\u002FL, µg\u002FL, ng\u002FL, g\u002FL)                                                                             |\n| Conductivity   | `milliSiemensPerMeterToMicroSiemensPerCm`, `milliSiemensPerCmToMicroSiemensPerCm`                                                                            |\n\nEvery function has a page in the [API reference](\u002Fcore\u002Fapi).\n\n## Converting by a user's preference\n\nFor flow, power and volume there are paired helpers that take the display unit as an argument. They fit a settings screen where the user picks units once:\n\n```ts\nimport {\n  flowFromCanonical,\n  flowToCanonical,\n  type FlowUnits,\n} from '@welldot\u002Fcore';\n\nconst unit: FlowUnits = 'L\u002Fs'; \u002F\u002F 'm3\u002Fh' | 'L\u002Fs' | 'gpm'\n\nflowFromCanonical(36, unit); \u002F\u002F 10, to show a stored 36 m³\u002Fh\nflowToCanonical(10, 'gpm'); \u002F\u002F 2.27…, to store a typed 10 gpm\n```\n\n`powerFromCanonical` \u002F `powerToCanonical` take `'kW' | 'cv' | 'hp'`, and `volumeFromCanonical` \u002F `volumeToCanonical` take `'m3' | 'L' | 'ft3' | 'gal'` (US gallon). The `Units` type groups the preferences (`length`, `diameter`, `flow`, `power`, `volume`) and is what `@welldot\u002Frender` accepts.\n\n## Diameters and slots: the traps\n\n- **Nominal sizes are not diameters.** `inchesToMm(6)` is 152.4 mm, but 6 in steel pipe has an outer diameter of 168.3 mm, and the file stores the real outer diameter ([as-built convention](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#diameter-and-the-as-built-convention)). Use the conversion for boreholes and true measurements; map trade sizes to real diameters in your input form.\n- **Slot numbers** are thousandths of an inch: `slotNumberToMm(20)` is 0.508 mm ([screen slot](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#screen-slot)).\n\n## Coordinates\n\n```ts\nimport { decimalDegreesToDms, dmsToDecimalDegrees } from '@welldot\u002Fcore';\n\ndecimalDegreesToDms(-1.4558, 'lat');\n\u002F\u002F { degrees: 1, minutes: 27, seconds: 20.88, direction: 'S' }\n\ndmsToDecimalDegrees({\n  degrees: 1,\n  minutes: 27,\n  seconds: 20.88,\n  direction: 'S',\n});\n\u002F\u002F -1.4558\n```\n\nProjected coordinates (UTM) are out of scope: convert them with a projection library such as `proj4` before writing `location` ([CRS scope](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#crs-scope)).\n\n## Laboratory reports\n\nLab reports use many unit spellings. These helpers map them onto the file's conventions ([water quality units](\u002Fformat\u002Fspec\u002Fv2\u002Fwater-quality#units)):\n\n```ts\nimport {\n  concentrationToCanonical,\n  expandedToStandardUncertainty,\n  normalizeColorUnit,\n  turbidityCodeForUnit,\n} from '@welldot\u002Fcore';\n\nconcentrationToCanonical(50, 'ug\u002FL'); \u002F\u002F 0.05 mg\u002FL\nturbidityCodeForUnit('NTU'); \u002F\u002F 'turbidity_ntu', the parameter code to use\nnormalizeColorUnit('mg Pt-Co\u002FL'); \u002F\u002F 'uH'\nexpandedToStandardUncertainty(0.04); \u002F\u002F 0.02, U \u002F k with k = 2, for value_precision\n```\n\nThe last one implements the spec's rule that `value_precision` is one standard deviation, not the expanded uncertainty ([precision](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#precision-and-uncertainty)).\n",{"title":7,"description":949},"core\u002F2.guides\u002F3.unit-conversion","q4KDubuRAUlI9P29qw6Z_5etI7zzZS5FrB1dlbYa-l0",{"docs_en":958,"spec":1270,"changelogs":1320},[959,979,998,1049,1159,1213],{"title":960,"path":961,"stem":962,"children":963},"Ai","\u002Fai","ai",[964,967,971,975],{"title":965,"path":961,"stem":966},"Introduction","ai\u002Findex",{"title":968,"path":969,"stem":970},"Converting reports with an assistant","\u002Fai\u002Fconversion-skill","ai\u002Fconversion-skill",{"title":972,"path":973,"stem":974},"llms.txt and Markdown pages","\u002Fai\u002Fllms","ai\u002Fllms",{"title":976,"path":977,"stem":978},"MCP server","\u002Fai\u002Fmcp","ai\u002Fmcp",{"title":980,"path":981,"stem":982,"children":983},"Contributing","\u002Fcontributing","contributing",[984,986,990,994],{"title":965,"path":981,"stem":985},"contributing\u002Findex",{"title":987,"path":988,"stem":989},"Writing docs","\u002Fcontributing\u002Fwriting-docs","contributing\u002F1.writing-docs",{"title":991,"path":992,"stem":993},"Update rules","\u002Fcontributing\u002Fupdate-rules","contributing\u002F2.update-rules",{"title":995,"path":996,"stem":997},"Content components","\u002Fcontributing\u002Fcomponents","contributing\u002Fcomponents",{"title":999,"path":1000,"stem":1001,"children":1002},"Core","\u002Fcore","core",[1003,1005,1019,1045],{"title":965,"path":1000,"stem":1004},"core\u002Findex",{"title":1006,"path":1007,"stem":1008,"children":1009,"page":1018},"Getting Started","\u002Fcore\u002Fgetting-started","core\u002F1.getting-started",[1010,1014],{"title":1011,"path":1012,"stem":1013},"Installation","\u002Fcore\u002Fgetting-started\u002Finstallation","core\u002F1.getting-started\u002F1.installation",{"title":1015,"path":1016,"stem":1017},"First use","\u002Fcore\u002Fgetting-started\u002Ffirst-use","core\u002F1.getting-started\u002F2.first-use",false,{"title":1020,"path":1021,"stem":1022,"children":1023,"page":1018},"Guides","\u002Fcore\u002Fguides","core\u002F2.guides",[1024,1028,1032,1033,1037,1041],{"title":1025,"path":1026,"stem":1027},"Parsing and validating","\u002Fcore\u002Fguides\u002Fparsing-and-validating","core\u002F2.guides\u002F1.parsing-and-validating",{"title":1029,"path":1030,"stem":1031},"Serializing and sharing","\u002Fcore\u002Fguides\u002Fserializing-and-sharing","core\u002F2.guides\u002F2.serializing-and-sharing",{"title":7,"path":952,"stem":955},{"title":1034,"path":1035,"stem":1036},"Vocabularies and textures","\u002Fcore\u002Fguides\u002Fvocabularies-and-textures","core\u002F2.guides\u002F4.vocabularies-and-textures",{"title":1038,"path":1039,"stem":1040},"Water quality vocabulary","\u002Fcore\u002Fguides\u002Fwater-quality-vocabulary","core\u002F2.guides\u002F5.water-quality-vocabulary",{"title":1042,"path":1043,"stem":1044},"Versions and time zones","\u002Fcore\u002Fguides\u002Fversions-and-time-zones","core\u002F2.guides\u002F6.versions-and-time-zones",{"title":376,"path":375,"stem":1046,"children":1047},"core\u002Fapi\u002Findex",[1048],{"title":376,"path":375,"stem":1046},{"title":1050,"path":1051,"stem":1052,"children":1053},"Format","\u002Fformat","format",[1054,1056,1076,1105,1129,1149,1155],{"title":965,"path":1051,"stem":1055},"format\u002Findex",{"title":1006,"path":1057,"stem":1058,"children":1059,"page":1018},"\u002Fformat\u002Fgetting-started","format\u002F1.getting-started",[1060,1064,1068,1072],{"title":1061,"path":1062,"stem":1063},"What is .well?","\u002Fformat\u002Fgetting-started\u002Fwhat-is-well","format\u002F1.getting-started\u002F1.what-is-well",{"title":1065,"path":1066,"stem":1067},"For geologists","\u002Fformat\u002Fgetting-started\u002Ffor-geologists","format\u002F1.getting-started\u002F2.for-geologists",{"title":1069,"path":1070,"stem":1071},"For developers","\u002Fformat\u002Fgetting-started\u002Ffor-developers","format\u002F1.getting-started\u002F3.for-developers",{"title":1073,"path":1074,"stem":1075},"Your first .well file","\u002Fformat\u002Fgetting-started\u002Ffirst-well-file","format\u002F1.getting-started\u002F4.first-well-file",{"title":1077,"path":1078,"stem":1079,"children":1080,"page":1018},"Concepts","\u002Fformat\u002Fconcepts","format\u002F2.concepts",[1081,1085,1089,1093,1097,1101],{"title":1082,"path":1083,"stem":1084},"Depths and intervals","\u002Fformat\u002Fconcepts\u002Fdepths-and-intervals","format\u002F2.concepts\u002F1.depths-and-intervals",{"title":1086,"path":1087,"stem":1088},"Units and precision","\u002Fformat\u002Fconcepts\u002Funits-and-precision","format\u002F2.concepts\u002F2.units-and-precision",{"title":1090,"path":1091,"stem":1092},"Vocabularies","\u002Fformat\u002Fconcepts\u002Fvocabularies","format\u002F2.concepts\u002F3.vocabularies",{"title":1094,"path":1095,"stem":1096},"Profiles","\u002Fformat\u002Fconcepts\u002Fprofiles","format\u002F2.concepts\u002F4.profiles",{"title":1098,"path":1099,"stem":1100},"Versions and deprecation","\u002Fformat\u002Fconcepts\u002Fversions-and-deprecation","format\u002F2.concepts\u002F5.versions-and-deprecation",{"title":1102,"path":1103,"stem":1104},"Extensibility","\u002Fformat\u002Fconcepts\u002Fextensibility","format\u002F2.concepts\u002F6.extensibility",{"title":1020,"path":1106,"stem":1107,"children":1108,"page":1018},"\u002Fformat\u002Fguides","format\u002F3.guides",[1109,1113,1117,1121,1125],{"title":1110,"path":1111,"stem":1112},"Writing a .well by hand","\u002Fformat\u002Fguides\u002Fwriting-by-hand","format\u002F3.guides\u002F1.writing-by-hand",{"title":1114,"path":1115,"stem":1116},"Converting a report","\u002Fformat\u002Fguides\u002Fconverting-a-report","format\u002F3.guides\u002F2.converting-a-report",{"title":1118,"path":1119,"stem":1120},"Validating","\u002Fformat\u002Fguides\u002Fvalidating","format\u002F3.guides\u002F3.validating",{"title":1122,"path":1123,"stem":1124},"Extending for your own needs","\u002Fformat\u002Fguides\u002Fextending","format\u002F3.guides\u002F4.extending",{"title":1126,"path":1127,"stem":1128},"Building an editor or database on .well","\u002Fformat\u002Fguides\u002Fbuilding-on-well","format\u002F3.guides\u002F5.building-on-well",{"title":1130,"path":1131,"stem":1132,"children":1133},"Overview","\u002Fformat\u002Freference","format\u002F4.reference\u002Findex",[1134,1135,1139,1143],{"title":1130,"path":1131,"stem":1132},{"title":1136,"path":1137,"stem":1138},"JSON Schema","\u002Fformat\u002Freference\u002Fjson-schema","format\u002F4.reference\u002F1.json-schema",{"title":1140,"path":1141,"stem":1142},"Example wells","\u002Fformat\u002Freference\u002Fexamples","format\u002F4.reference\u002F2.examples",{"title":1144,"path":1145,"stem":1146,"children":1147},"Object reference","\u002Fformat\u002Freference\u002Fobjects","format\u002Freference\u002Fobjects\u002Findex",[1148],{"title":1144,"path":1145,"stem":1146},{"title":1150,"path":1151,"stem":1152,"children":1153},"About the spec","\u002Fformat\u002Fspec","format\u002F5.spec\u002Findex",[1154],{"title":1150,"path":1151,"stem":1152},{"title":1156,"path":1157,"stem":1158},"Changelog","\u002Fformat\u002Fchangelog","format\u002F6.changelog",{"title":1160,"path":1161,"stem":1162,"children":1163},"Render","\u002Frender","render",[1164,1166,1176,1208],{"title":965,"path":1161,"stem":1165},"render\u002Findex",{"title":1006,"path":1167,"stem":1168,"children":1169,"page":1018},"\u002Frender\u002Fgetting-started","render\u002F1.getting-started",[1170,1173],{"title":1011,"path":1171,"stem":1172},"\u002Frender\u002Fgetting-started\u002Finstallation","render\u002F1.getting-started\u002F1.installation",{"title":1015,"path":1174,"stem":1175},"\u002Frender\u002Fgetting-started\u002Ffirst-use","render\u002F1.getting-started\u002F2.first-use",{"title":1020,"path":1177,"stem":1178,"children":1179,"page":1018},"\u002Frender\u002Fguides","render\u002F2.guides",[1180,1184,1188,1192,1196,1200,1204],{"title":1181,"path":1182,"stem":1183},"Panels and layout","\u002Frender\u002Fguides\u002Fpanels-and-layout","render\u002F2.guides\u002F1.panels-and-layout",{"title":1185,"path":1186,"stem":1187},"Layers and labels","\u002Frender\u002Fguides\u002Flayers-and-labels","render\u002F2.guides\u002F2.layers-and-labels",{"title":1189,"path":1190,"stem":1191},"Theming","\u002Frender\u002Fguides\u002Ftheming","render\u002F2.guides\u002F3.theming",{"title":1193,"path":1194,"stem":1195},"Locale and units","\u002Frender\u002Fguides\u002Flocale-and-units","render\u002F2.guides\u002F4.locale-and-units",{"title":1197,"path":1198,"stem":1199},"Legends","\u002Frender\u002Fguides\u002Flegends","render\u002F2.guides\u002F5.legends",{"title":1201,"path":1202,"stem":1203},"Zoom, pan and highlights","\u002Frender\u002Fguides\u002Finteraction","render\u002F2.guides\u002F6.interaction",{"title":1205,"path":1206,"stem":1207},"Using it in a framework","\u002Frender\u002Fguides\u002Fframeworks","render\u002F2.guides\u002F7.frameworks",{"title":376,"path":1209,"stem":1210,"children":1211},"\u002Frender\u002Fapi","render\u002Fapi\u002Findex",[1212],{"title":376,"path":1209,"stem":1210},{"title":1214,"path":1215,"stem":1216,"children":1217},"Utils","\u002Futils","utils",[1218,1220,1230,1265],{"title":965,"path":1215,"stem":1219},"utils\u002Findex",{"title":1006,"path":1221,"stem":1222,"children":1223,"page":1018},"\u002Futils\u002Fgetting-started","utils\u002F1.getting-started",[1224,1227],{"title":1011,"path":1225,"stem":1226},"\u002Futils\u002Fgetting-started\u002Finstallation","utils\u002F1.getting-started\u002F1.installation",{"title":1015,"path":1228,"stem":1229},"\u002Futils\u002Fgetting-started\u002Ffirst-use","utils\u002F1.getting-started\u002F2.first-use",{"title":1020,"path":1231,"stem":1232,"children":1233,"page":1018},"\u002Futils\u002Fguides","utils\u002F2.guides",[1234,1238,1242,1246,1250,1254,1258,1262],{"title":1235,"path":1236,"stem":1237},"Geometry and volumes","\u002Futils\u002Fguides\u002Fgeometry-and-volumes","utils\u002F2.guides\u002F1.geometry-and-volumes",{"title":1239,"path":1240,"stem":1241},"Water levels and pumping tests","\u002Futils\u002Fguides\u002Fpumping-tests","utils\u002F2.guides\u002F2.pumping-tests",{"title":1243,"path":1244,"stem":1245},"Permits","\u002Futils\u002Fguides\u002Fpermits","utils\u002F2.guides\u002F3.permits",{"title":1247,"path":1248,"stem":1249},"Operation and production","\u002Futils\u002Fguides\u002Foperation","utils\u002F2.guides\u002F4.operation",{"title":1251,"path":1252,"stem":1253},"Water quality","\u002Futils\u002Fguides\u002Fwater-quality","utils\u002F2.guides\u002F5.water-quality",{"title":1255,"path":1256,"stem":1257},"Logger import","\u002Futils\u002Fguides\u002Flogger-import","utils\u002F2.guides\u002F6.logger-import",{"title":1259,"path":1260,"stem":1261},"SIAGAS import","\u002Futils\u002Fguides\u002Fsiagas-import","utils\u002F2.guides\u002F7.siagas-import",{"title":1263,"path":161,"stem":1264},"Formatting","utils\u002F2.guides\u002F8.formatting",{"title":376,"path":1266,"stem":1267,"children":1268},"\u002Futils\u002Fapi","utils\u002Fapi\u002Findex",[1269],{"title":376,"path":1266,"stem":1267},[1271],{"title":1050,"path":1051,"stem":1052,"children":1272,"page":1018},[1273],{"title":1274,"path":1151,"stem":1275,"children":1276,"page":1018},"Spec","format\u002Fspec",[1277,1286,1295],{"title":1278,"path":1279,"stem":1280,"children":1281,"page":1018},"Reference","\u002Fformat\u002Fspec\u002Freference","format\u002Fspec\u002Freference",[1282],{"title":1283,"path":1284,"stem":1285},"FGDC Texture Patterns Reference","\u002Fformat\u002Fspec\u002Freference\u002Ffgdc-textures","format\u002Fspec\u002Freference\u002Ffgdc-textures",{"title":1287,"path":1288,"stem":1289,"children":1290,"page":1018},"V1","\u002Fformat\u002Fspec\u002Fv1","format\u002Fspec\u002Fv1",[1291],{"title":1292,"path":1293,"stem":1294},".well File Format Specification","\u002Fformat\u002Fspec\u002Fv1\u002Fwell-format","format\u002Fspec\u002Fv1\u002Fwell-format",{"title":1296,"path":1297,"stem":1298,"children":1299,"page":1018},"V2","\u002Fformat\u002Fspec\u002Fv2","format\u002Fspec\u002Fv2",[1300,1304,1308,1312,1316],{"title":1301,"path":1302,"stem":1303},".well File Format Specification — Version 2.4: Format Reference","\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference","format\u002Fspec\u002Fv2\u002Fformat-reference",{"title":1305,"path":1306,"stem":1307},".well File Format Specification — Version 2.4: Interoperability","\u002Fformat\u002Fspec\u002Fv2\u002Finteroperability","format\u002Fspec\u002Fv2\u002Finteroperability",{"title":1309,"path":1310,"stem":1311},".well File Format Specification — Version 2.4: Object Schemas","\u002Fformat\u002Fspec\u002Fv2\u002Fobject-schemas","format\u002Fspec\u002Fv2\u002Fobject-schemas",{"title":1313,"path":1314,"stem":1315},".well File Format Specification — Version 2.4: Overview","\u002Fformat\u002Fspec\u002Fv2\u002Foverview","format\u002Fspec\u002Fv2\u002Foverview",{"title":1317,"path":1318,"stem":1319},".well File Format Specification — Version 2.4: Water Quality","\u002Fformat\u002Fspec\u002Fv2\u002Fwater-quality","format\u002Fspec\u002Fv2\u002Fwater-quality",[1321,1326,1331],{"title":999,"path":1000,"stem":1001,"children":1322,"page":1018},[1323],{"title":28,"path":1324,"stem":1325},"\u002Fcore\u002Fchangelog","core\u002FCHANGELOG",{"title":1160,"path":1161,"stem":1162,"children":1327,"page":1018},[1328],{"title":570,"path":1329,"stem":1330},"\u002Frender\u002Fchangelog","render\u002FCHANGELOG",{"title":1214,"path":1215,"stem":1216,"children":1332,"page":1018},[1333],{"title":164,"path":1334,"stem":1335},"\u002Futils\u002Fchangelog","utils\u002FCHANGELOG",1793050497182]