github.com/searKing/golang/go@v1.2.117/format/multiple_prefix/example_test.go (about)

     1  // Copyright 2020 The searKing Author. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package multiple_prefix_test
     6  
     7  import (
     8  	"fmt"
     9  	"math/big"
    10  
    11  	"github.com/searKing/golang/go/format/multiple_prefix"
    12  )
    13  
    14  func ExampleDecimalFormatFloat() {
    15  	fmt.Printf("%s\n", multiple_prefix.DecimalFormatFloat(1234.56789, 4))
    16  
    17  	// Output:
    18  	// 1.2346k
    19  }
    20  
    21  func ExampleDecimalFormatInt() {
    22  	fmt.Printf("%s\n", multiple_prefix.DecimalFormatInt(-1234, 4))
    23  
    24  	// Output:
    25  	// -1.234k
    26  }
    27  
    28  func ExampleDecimalFormatUint() {
    29  	fmt.Printf("%s\n", multiple_prefix.DecimalFormatUint(1234, 4))
    30  
    31  	// Output:
    32  	// 1.234k
    33  }
    34  
    35  func ExampleDecimalFormatInt64() {
    36  	fmt.Printf("%s\n", multiple_prefix.DecimalFormatInt64(-123456789, 4))
    37  
    38  	// Output:
    39  	// -123.4568M
    40  }
    41  
    42  func ExampleDecimalFormatUint64() {
    43  	fmt.Printf("%s\n", multiple_prefix.DecimalFormatUint64(123456789, 4))
    44  
    45  	// Output:
    46  	// 123.4568M
    47  }
    48  
    49  func ExampleBinaryFormatFloat() {
    50  	fmt.Printf("%s\n", multiple_prefix.BinaryFormatFloat(1024.1024, 4))
    51  
    52  	// Output:
    53  	// 1.0001Ki
    54  }
    55  
    56  func ExampleBinaryFormatInt() {
    57  	fmt.Printf("%s\n", multiple_prefix.BinaryFormatInt(-1024*1024, 4))
    58  
    59  	// Output:
    60  	// -1Mi
    61  }
    62  
    63  func ExampleBinaryFormatUint() {
    64  	fmt.Printf("%s\n", multiple_prefix.BinaryFormatUint(1024*10000, 4))
    65  
    66  	// Output:
    67  	// 9.7656Mi
    68  }
    69  
    70  func ExampleBinaryFormatInt64() {
    71  	fmt.Printf("%s\n", multiple_prefix.BinaryFormatInt64(-1024*1024, 4))
    72  
    73  	// Output:
    74  	// -1Mi
    75  }
    76  
    77  func ExampleBinaryFormatUint64() {
    78  	fmt.Printf("%s\n", multiple_prefix.BinaryFormatUint64(1024*1024, 4))
    79  
    80  	// Output:
    81  	// 1Mi
    82  }
    83  
    84  func ExampleSplitDecimal() {
    85  	s := "+1234.567890\tkBHello\tWorld"
    86  
    87  	gotNumber, gotPrefix, gotUnparsed := multiple_prefix.SplitDecimal(s)
    88  	fmt.Printf("%s\n", s)
    89  	fmt.Printf("Number:%s\n", gotNumber)
    90  	fmt.Printf("Symbol:%s\n", gotPrefix.Symbol())
    91  	fmt.Printf("Unparsed:%s\n", gotUnparsed)
    92  
    93  	// Output:
    94  	// +1234.567890	kBHello	World
    95  	// Number:+1234.567890
    96  	// Symbol:k
    97  	// Unparsed:BHello	World
    98  }
    99  
   100  func ExampleSplitBinary() {
   101  	s := "+1234.567890 KiBHelloWorld"
   102  
   103  	gotNumber, gotPrefix, gotUnparsed := multiple_prefix.SplitBinary(s)
   104  	fmt.Printf("%s\n", s)
   105  	fmt.Printf("Number:%s\n", gotNumber)
   106  	fmt.Printf("Symbol:%s\n", gotPrefix.Symbol())
   107  	fmt.Printf("Unparsed:%s\n", gotUnparsed)
   108  
   109  	// Output:
   110  	// +1234.567890 KiBHelloWorld
   111  	// Number:+1234.567890
   112  	// Symbol:Ki
   113  	// Unparsed:BHelloWorld
   114  }
   115  
   116  func ExampleDecimalMultiplePrefix_SetFloat64() {
   117  	n := 1234.56789
   118  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetFloat64(n)
   119  
   120  	fmt.Printf("%g\n", n)
   121  	fmt.Printf("Base:%d\n", mp.Base())
   122  	fmt.Printf("Power:%d\n", mp.Power())
   123  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   124  	fmt.Printf("Name:%s\n", mp.Name())
   125  	// Output:
   126  	// 1234.56789
   127  	// Base:10
   128  	// Power:3
   129  	// Symbol:k
   130  	// Name:kilo
   131  }
   132  
   133  func ExampleDecimalMultiplePrefix_SetInt64() {
   134  	n := int64(-2 * 1000 * 1000)
   135  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetInt64(n)
   136  
   137  	fmt.Printf("%d\n", n)
   138  	fmt.Printf("Base:%d\n", mp.Base())
   139  	fmt.Printf("Power:%d\n", mp.Power())
   140  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   141  	fmt.Printf("Name:%s\n", mp.Name())
   142  	// Output:
   143  	// -2000000
   144  	// Base:10
   145  	// Power:6
   146  	// Symbol:M
   147  	// Name:mega
   148  }
   149  
   150  func ExampleDecimalMultiplePrefix_SetUint64() {
   151  	n := uint64(2 * 1000 * 1000)
   152  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetUint64(n)
   153  
   154  	fmt.Printf("%d\n", n)
   155  	fmt.Printf("Base:%d\n", mp.Base())
   156  	fmt.Printf("Power:%d\n", mp.Power())
   157  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   158  	fmt.Printf("Name:%s\n", mp.Name())
   159  	// Output:
   160  	// 2000000
   161  	// Base:10
   162  	// Power:6
   163  	// Symbol:M
   164  	// Name:mega
   165  }
   166  
   167  func ExampleDecimalMultiplePrefix_SetBigFloat() {
   168  	n := big.NewFloat(1234.5678)
   169  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetBigFloat(n)
   170  
   171  	f, _ := n.Float64()
   172  	fmt.Printf("%g\n", f)
   173  	fmt.Printf("Base:%d\n", mp.Base())
   174  	fmt.Printf("Power:%d\n", mp.Power())
   175  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   176  	fmt.Printf("Name:%s\n", mp.Name())
   177  	// Output:
   178  	// 1234.5678
   179  	// Base:10
   180  	// Power:3
   181  	// Symbol:k
   182  	// Name:kilo
   183  }
   184  
   185  func ExampleDecimalMultiplePrefix_SetBigInt() {
   186  	n := big.NewInt(-2 * 1000 * 1000)
   187  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetBigInt(n)
   188  
   189  	fmt.Printf("%d\n", n.Int64())
   190  	fmt.Printf("Base:%d\n", mp.Base())
   191  	fmt.Printf("Power:%d\n", mp.Power())
   192  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   193  	fmt.Printf("Name:%s\n", mp.Name())
   194  	// Output:
   195  	// -2000000
   196  	// Base:10
   197  	// Power:6
   198  	// Symbol:M
   199  	// Name:mega
   200  }
   201  
   202  func ExampleDecimalMultiplePrefix_SetBigRat() {
   203  	n := big.NewRat(-4*1000*1000, 2)
   204  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetBigRat(n)
   205  
   206  	f, _ := n.Float64()
   207  
   208  	fmt.Printf("%g\n", f)
   209  	fmt.Printf("Base:%d\n", mp.Base())
   210  	fmt.Printf("Power:%d\n", mp.Power())
   211  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   212  	fmt.Printf("Name:%s\n", mp.Name())
   213  	// Output:
   214  	// -2e+06
   215  	// Base:10
   216  	// Power:6
   217  	// Symbol:M
   218  	// Name:mega
   219  }
   220  
   221  func ExampleBinaryMultiplePrefix_SetFloat64() {
   222  	n := 1234.56789
   223  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetFloat64(n)
   224  
   225  	fmt.Printf("%g\n", n)
   226  	fmt.Printf("Base:%d\n", mp.Base())
   227  	fmt.Printf("Power:%d\n", mp.Power())
   228  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   229  	fmt.Printf("Name:%s\n", mp.Name())
   230  	// Output:
   231  	// 1234.56789
   232  	// Base:2
   233  	// Power:10
   234  	// Symbol:Ki
   235  	// Name:kibi
   236  }
   237  
   238  func ExampleBinaryMultiplePrefix_SetInt64() {
   239  	n := int64(-2 * 1024 * 1024)
   240  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetInt64(n)
   241  
   242  	fmt.Printf("%d\n", n)
   243  	fmt.Printf("Base:%d\n", mp.Base())
   244  	fmt.Printf("Power:%d\n", mp.Power())
   245  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   246  	fmt.Printf("Name:%s\n", mp.Name())
   247  	// Output:
   248  	// -2097152
   249  	// Base:2
   250  	// Power:20
   251  	// Symbol:Mi
   252  	// Name:mebi
   253  }
   254  
   255  func ExampleBinaryMultiplePrefix_SetUint64() {
   256  	n := uint64(2 * 1024 * 1024)
   257  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetUint64(n)
   258  
   259  	fmt.Printf("%d\n", n)
   260  	fmt.Printf("Base:%d\n", mp.Base())
   261  	fmt.Printf("Power:%d\n", mp.Power())
   262  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   263  	fmt.Printf("Name:%s\n", mp.Name())
   264  	// Output:
   265  	// 2097152
   266  	// Base:2
   267  	// Power:20
   268  	// Symbol:Mi
   269  	// Name:mebi
   270  }
   271  
   272  func ExampleBinaryMultiplePrefix_SetBigFloat() {
   273  	n := big.NewFloat(1234.5678)
   274  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetBigFloat(n)
   275  
   276  	f, _ := n.Float64()
   277  	fmt.Printf("%g\n", f)
   278  	fmt.Printf("Base:%d\n", mp.Base())
   279  	fmt.Printf("Power:%d\n", mp.Power())
   280  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   281  	fmt.Printf("Name:%s\n", mp.Name())
   282  	// Output:
   283  	// 1234.5678
   284  	// Base:2
   285  	// Power:10
   286  	// Symbol:Ki
   287  	// Name:kibi
   288  }
   289  
   290  func ExampleBinaryMultiplePrefix_SetBigInt() {
   291  	n := big.NewInt(-2 * 1024 * 1024)
   292  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetBigInt(n)
   293  
   294  	fmt.Printf("%d\n", n.Int64())
   295  	fmt.Printf("Base:%d\n", mp.Base())
   296  	fmt.Printf("Power:%d\n", mp.Power())
   297  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   298  	fmt.Printf("Name:%s\n", mp.Name())
   299  	// Output:
   300  	// -2097152
   301  	// Base:2
   302  	// Power:20
   303  	// Symbol:Mi
   304  	// Name:mebi
   305  }
   306  
   307  func ExampleBinaryMultiplePrefix_SetBigRat() {
   308  	n := big.NewRat(-4*1024*1024, 2)
   309  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetBigRat(n)
   310  
   311  	f, _ := n.Float64()
   312  
   313  	fmt.Printf("%g\n", f)
   314  	fmt.Printf("Base:%d\n", mp.Base())
   315  	fmt.Printf("Power:%d\n", mp.Power())
   316  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   317  	fmt.Printf("Name:%s\n", mp.Name())
   318  	// Output:
   319  	// -2.097152e+06
   320  	// Base:2
   321  	// Power:20
   322  	// Symbol:Mi
   323  	// Name:mebi
   324  }
   325  
   326  func ExampleDecimalMultiplePrefix_SetPrefix() {
   327  	prefix := "kilo"
   328  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetPrefix(prefix)
   329  
   330  	fmt.Printf("%s\n", prefix)
   331  	fmt.Printf("Base:%d\n", mp.Base())
   332  	fmt.Printf("Power:%d\n", mp.Power())
   333  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   334  	fmt.Printf("Name:%s\n", mp.Name())
   335  
   336  	prefix = "k"
   337  	mp = multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetPrefix(prefix)
   338  
   339  	fmt.Printf("%s\n", prefix)
   340  	fmt.Printf("Base:%d\n", mp.Base())
   341  	fmt.Printf("Power:%d\n", mp.Power())
   342  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   343  	fmt.Printf("Name:%s\n", mp.Name())
   344  	// Output:
   345  	// kilo
   346  	// Base:10
   347  	// Power:3
   348  	// Symbol:k
   349  	// Name:kilo
   350  	// k
   351  	// Base:10
   352  	// Power:3
   353  	// Symbol:k
   354  	// Name:kilo
   355  }
   356  
   357  func ExampleBinaryMultiplePrefix_SetPrefix() {
   358  	prefix := "kibi"
   359  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetPrefix(prefix)
   360  
   361  	fmt.Printf("%s\n", prefix)
   362  	fmt.Printf("Base:%d\n", mp.Base())
   363  	fmt.Printf("Power:%d\n", mp.Power())
   364  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   365  	fmt.Printf("Name:%s\n", mp.Name())
   366  
   367  	prefix = "Ki"
   368  	mp = multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetPrefix(prefix)
   369  
   370  	fmt.Printf("%s\n", prefix)
   371  	fmt.Printf("Base:%d\n", mp.Base())
   372  	fmt.Printf("Power:%d\n", mp.Power())
   373  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   374  	fmt.Printf("Name:%s\n", mp.Name())
   375  	// Output:
   376  	// kibi
   377  	// Base:2
   378  	// Power:10
   379  	// Symbol:Ki
   380  	// Name:kibi
   381  	// Ki
   382  	// Base:2
   383  	// Power:10
   384  	// Symbol:Ki
   385  	// Name:kibi
   386  }
   387  
   388  func ExampleDecimalMultiplePrefix_SetPower() {
   389  	p := 3
   390  	mp := multiple_prefix.DecimalMultiplePrefixTODO.Copy().SetPower(p)
   391  
   392  	fmt.Printf("%d\n", p)
   393  	fmt.Printf("Base:%d\n", mp.Base())
   394  	fmt.Printf("Power:%d\n", mp.Power())
   395  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   396  	fmt.Printf("Name:%s\n", mp.Name())
   397  	// Output:
   398  	// 3
   399  	// Base:10
   400  	// Power:3
   401  	// Symbol:k
   402  	// Name:kilo
   403  
   404  }
   405  
   406  func ExampleBinaryMultiplePrefix_SetPower() {
   407  	p := 10
   408  	mp := multiple_prefix.BinaryMultiplePrefixTODO.Copy().SetPower(p)
   409  
   410  	fmt.Printf("%d\n", p)
   411  	fmt.Printf("Base:%d\n", mp.Base())
   412  	fmt.Printf("Power:%d\n", mp.Power())
   413  	fmt.Printf("Symbol:%s\n", mp.Symbol())
   414  	fmt.Printf("Name:%s\n", mp.Name())
   415  	// Output:
   416  	// 10
   417  	// Base:2
   418  	// Power:10
   419  	// Symbol:Ki
   420  	// Name:kibi
   421  }
   422  
   423  /*
   424  // for go vet
   425  
   426  func ExampleMultiplePrefix_Base() {
   427  	fmt.Printf("%d\n", multiple_prefix.DecimalMultiplePrefixTODO.Copy().Base())
   428  	fmt.Printf("%d\n", multiple_prefix.BinaryMultiplePrefixTODO.Copy().Base())
   429  
   430  	// Output:
   431  	// 10
   432  	// 2
   433  }
   434  
   435  func ExampleMultiplePrefix_Factor() {
   436  	// Decimal
   437  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixYocto.Copy().Factor())
   438  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixZepto.Copy().Factor())
   439  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixAtto.Copy().Factor())
   440  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixFemto.Copy().Factor())
   441  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixPico.Copy().Factor())
   442  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixNano.Copy().Factor())
   443  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixMicro.Copy().Factor())
   444  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixMilli.Copy().Factor())
   445  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixDeci.Copy().Factor())
   446  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixCenti.Copy().Factor())
   447  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixOne.Copy().Factor())
   448  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixHecto.Copy().Factor())
   449  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixDeka.Copy().Factor())
   450  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixKilo.Copy().Factor())
   451  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixMega.Copy().Factor())
   452  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixGiga.Copy().Factor())
   453  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixTera.Copy().Factor())
   454  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixPeta.Copy().Factor())
   455  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixExa.Copy().Factor())
   456  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixZetta.Copy().Factor())
   457  	fmt.Printf("%g\n", multiple_prefix.DecimalMultiplePrefixYotta.Copy().Factor())
   458  
   459  	// Binary
   460  	fmt.Printf("%b\n", int64(multiple_prefix.BinaryMultiplePrefixOne.Copy().Factor()))
   461  	fmt.Printf("%b\n", int64(multiple_prefix.BinaryMultiplePrefixKibi.Copy().Factor()))
   462  	fmt.Printf("%b\n", int64(multiple_prefix.BinaryMultiplePrefixMebi.Copy().Factor()))
   463  	fmt.Printf("%b\n", int64(multiple_prefix.BinaryMultiplePrefixGibi.Copy().Factor()))
   464  	fmt.Printf("%b\n", int64(multiple_prefix.BinaryMultiplePrefixTebi.Copy().Factor()))
   465  	fmt.Printf("%b\n", int64(multiple_prefix.BinaryMultiplePrefixPebi.Copy().Factor()))
   466  	fmt.Printf("%b\n", int64(multiple_prefix.BinaryMultiplePrefixExbi.Copy().Factor()))
   467  
   468  	// Output:
   469  	// 1.0000000000000001e-24
   470  	// 1e-21
   471  	// 1e-18
   472  	// 1e-15
   473  	// 1e-12
   474  	// 1e-09
   475  	// 1e-06
   476  	// 0.001
   477  	// 0.01
   478  	// 0.1
   479  	// 1
   480  	// 10
   481  	// 100
   482  	// 1000
   483  	// 1e+06
   484  	// 1e+09
   485  	// 1e+12
   486  	// 1e+15
   487  	// 1e+18
   488  	// 1e+19
   489  	// 1e+21
   490  	// 1
   491  	// 10000000000
   492  	// 100000000000000000000
   493  	// 1000000000000000000000000000000
   494  	// 10000000000000000000000000000000000000000
   495  	// 100000000000000000000000000000000000000000000000000
   496  	// 1000000000000000000000000000000000000000000000000000000000000
   497  }
   498  
   499  func ExampleMultiplePrefix_Name() {
   500  	// Decimal
   501  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixYocto.Copy().Name())
   502  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixZepto.Copy().Name())
   503  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixAtto.Copy().Name())
   504  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixFemto.Copy().Name())
   505  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixPico.Copy().Name())
   506  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixNano.Copy().Name())
   507  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixMicro.Copy().Name())
   508  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixMilli.Copy().Name())
   509  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixDeci.Copy().Name())
   510  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixCenti.Copy().Name())
   511  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixOne.Copy().Name())
   512  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixHecto.Copy().Name())
   513  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixDeka.Copy().Name())
   514  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixKilo.Copy().Name())
   515  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixMega.Copy().Name())
   516  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixGiga.Copy().Name())
   517  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixTera.Copy().Name())
   518  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixPeta.Copy().Name())
   519  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixExa.Copy().Name())
   520  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixZetta.Copy().Name())
   521  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixYotta.Copy().Name())
   522  
   523  	// Binary
   524  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixOne.Copy().Name())
   525  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixKibi.Copy().Name())
   526  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixMebi.Copy().Name())
   527  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixGibi.Copy().Name())
   528  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixTebi.Copy().Name())
   529  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixPebi.Copy().Name())
   530  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixExbi.Copy().Name())
   531  
   532  	// Output:
   533  	// yocto
   534  	// atto
   535  	// zepto
   536  	// femto
   537  	// pico
   538  	// nano
   539  	// micro
   540  	// milli
   541  	// deci
   542  	// centi
   543  	//
   544  	// hecto
   545  	// deka
   546  	// kilo
   547  	// mega
   548  	// giga
   549  	// tera
   550  	// peta
   551  	// exa
   552  	// zetta
   553  	// yotta
   554  	//
   555  	// kibi
   556  	// mebi
   557  	// gibi
   558  	// tebi
   559  	// pebi
   560  	// exbi
   561  }
   562  
   563  func ExampleMultiplePrefix_Symbol() {
   564  	// Decimal
   565  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixYocto.Copy().Symbol())
   566  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixZepto.Copy().Symbol())
   567  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixAtto.Copy().Symbol())
   568  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixFemto.Copy().Symbol())
   569  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixPico.Copy().Symbol())
   570  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixNano.Copy().Symbol())
   571  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixMicro.Copy().Symbol())
   572  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixMilli.Copy().Symbol())
   573  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixDeci.Copy().Symbol())
   574  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixCenti.Copy().Symbol())
   575  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixOne.Copy().Symbol())
   576  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixHecto.Copy().Symbol())
   577  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixDeka.Copy().Symbol())
   578  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixKilo.Copy().Symbol())
   579  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixMega.Copy().Symbol())
   580  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixGiga.Copy().Symbol())
   581  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixTera.Copy().Symbol())
   582  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixPeta.Copy().Symbol())
   583  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixExa.Copy().Symbol())
   584  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixZetta.Copy().Symbol())
   585  	fmt.Printf("%s\n", multiple_prefix.DecimalMultiplePrefixYotta.Copy().Symbol())
   586  
   587  	// Binary
   588  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixOne.Copy().Symbol())
   589  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixKibi.Copy().Symbol())
   590  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixMebi.Copy().Symbol())
   591  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixGibi.Copy().Symbol())
   592  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixTebi.Copy().Symbol())
   593  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixPebi.Copy().Symbol())
   594  	fmt.Printf("%s\n", multiple_prefix.BinaryMultiplePrefixExbi.Copy().Symbol())
   595  
   596  	// Output:
   597  	// y
   598  	// z
   599  	// a
   600  	// f
   601  	// p
   602  	// n
   603  	// μ
   604  	// m
   605  	// m
   606  	// m
   607  	//
   608  	// h
   609  	// da
   610  	// k
   611  	// M
   612  	// G
   613  	// T
   614  	// P
   615  	// E
   616  	// Z
   617  	// Y
   618  	//
   619  	// Ki
   620  	// Mi
   621  	// Gi
   622  	// Ti
   623  	// Pi
   624  	// Ei
   625  }
   626  */