Coffee journaling on ATProto (alpha) alpha.arabica.social
coffee
17
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: band-aid for dealing with mixed F/C units in temperature

pdewey dc0f5488 12b3a879

+9 -3
+1 -2
flake.nix
··· 8 8 (system: function nixpkgs.legacyPackages.${system} system); 9 9 in { 10 10 devShells = forAllSystems (pkgs: system: { 11 - default = 12 - pkgs.mkShell { packages = with pkgs; [ go tailwindcss ]; }; 11 + default = pkgs.mkShell { packages = with pkgs; [ go tailwindcss ]; }; 13 12 }); 14 13 15 14 packages = forAllSystems (pkgs: system: rec {
+8 -1
internal/templates/helpers.go
··· 11 11 if temp == 0 { 12 12 return "N/A" 13 13 } 14 - return fmt.Sprintf("%.1f°C", temp) 14 + 15 + // REFACTOR: This probably isn't the best way to deal with units 16 + unit := 'C' 17 + if temp > 100 { 18 + unit = 'F' 19 + } 20 + 21 + return fmt.Sprintf("%.1f°%c", temp, unit) 15 22 } 16 23 17 24 func formatTempValue(temp float64) string {