Align hex floats right as default
Fixes #2308 

If this change to `write_bytes` isn't desired, the calling code could be changed to directly calling `write_padded<align::right>` with the lambda copied from `write_bytes`.
{"label": "fmtlib:master", "ref": "master", "sha": "7612f18dc8e0112e64e0845a1ebe9da6cfb8a123"}
From the documentation (emphasis mine):
<!--StartFragment-->
Option | Meaning
-- | --
'&lt;' | Forces the field to be left-aligned within the available space (this is the default for most objects).
'&gt;' | Forces the field to be right-aligned within the available space (***this is the default for numbers***).
'^' | Forces the field to be centered within the available space.

<!--EndFragment-->

```
fmt::print("'{:16f}'\n", 4.2f); // output: '        4.200000'
fmt::print("'{:16a}'\n", 4.2f); // output: '0x1.0cccccp+2   '
```

https://godbolt.org/z/Mf4nzdncs
Hex float default alignment
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 6df5d849de52..4237bb42d125 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1304,14 +1304,14 @@ constexpr OutputIt write_padded(OutputIt out,
   return write_padded<align>(out, specs, size, size, f);
 }
 
-template <typename Char, typename OutputIt>
+template <align::type align = align::left, typename Char, typename OutputIt>
 FMT_CONSTEXPR OutputIt write_bytes(OutputIt out, string_view bytes,
                                    const basic_format_specs<Char>& specs) {
-  return write_padded(out, specs, bytes.size(),
-                      [bytes](reserve_iterator<OutputIt> it) {
-                        const char* data = bytes.data();
-                        return copy_str<Char>(data, data + bytes.size(), it);
-                      });
+  return write_padded<align>(
+      out, specs, bytes.size(), [bytes](reserve_iterator<OutputIt> it) {
+        const char* data = bytes.data();
+        return copy_str<Char>(data, data + bytes.size(), it);
+      });
 }
 
 template <typename Char, typename OutputIt, typename UIntPtr>
@@ -1793,7 +1793,8 @@ OutputIt write(OutputIt out, T value, basic_format_specs<Char> specs,
   if (fspecs.format == float_format::hex) {
     if (fspecs.sign) buffer.push_back(data::signs[fspecs.sign]);
     snprintf_float(promote_float(value), specs.precision, fspecs, buffer);
-    return write_bytes(out, {buffer.data(), buffer.size()}, specs);
+    return write_bytes<align::right>(out, {buffer.data(), buffer.size()},
+                                     specs);
   }
   int precision = specs.precision >= 0 || !specs.type ? specs.precision : 6;
   if (fspecs.format == float_format::exp) {

diff --git a/test/format-test.cc b/test/format-test.cc
index cbed4984a2d0..5e37bf47ae27 100644
--- a/test/format-test.cc
+++ b/test/format-test.cc
@@ -1215,6 +1215,8 @@ TEST(format_test, format_double) {
   EXPECT_EQ("392.650000", fmt::format("{:f}", 392.65));
   EXPECT_EQ("392.650000", fmt::format("{:F}", 392.65));
   EXPECT_EQ("42", fmt::format("{:L}", 42.0));
+  EXPECT_EQ("    0x1.0cccccccccccdp+2", fmt::format("{:24a}", 4.2));
+  EXPECT_EQ("0x1.0cccccccccccdp+2    ", fmt::format("{:<24a}", 4.2));
   char buffer[buffer_size];
   safe_sprintf(buffer, "%e", 392.65);
   EXPECT_EQ(buffer, fmt::format("{0:e}", 392.65));

{"format-test": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"compile-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ostream-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ranges-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "core-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "scan-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "color-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "chrono-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "args-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "gtest-extra-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "unicode-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "assert-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "posix-mock-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "printf-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "wchar-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "format-impl-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "enforce-checks-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "os-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}}
{"format-test": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"passed_count": 18, "failed_count": 0, "skipped_count": 0, "passed_tests": ["format-test", "args-test", "gtest-extra-test", "compile-test", "ostream-test", "ranges-test", "assert-test", "unicode-test", "posix-mock-test", "core-test", "printf-test", "color-test", "scan-test", "format-impl-test", "wchar-test", "enforce-checks-test", "os-test", "chrono-test"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 17, "failed_count": 0, "skipped_count": 0, "passed_tests": ["args-test", "gtest-extra-test", "compile-test", "ostream-test", "ranges-test", "assert-test", "unicode-test", "posix-mock-test", "core-test", "printf-test", "color-test", "scan-test", "format-impl-test", "wchar-test", "enforce-checks-test", "os-test", "chrono-test"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 18, "failed_count": 0, "skipped_count": 0, "passed_tests": ["format-test", "args-test", "gtest-extra-test", "compile-test", "ostream-test", "ranges-test", "assert-test", "unicode-test", "posix-mock-test", "core-test", "printf-test", "color-test", "scan-test", "format-impl-test", "wchar-test", "enforce-checks-test", "os-test", "chrono-test"], "failed_tests": [], "skipped_tests": []}