The question whether something is digital or analog is actually hard. The point that the text you're citing makes is that anything that can be represented as a count of discrete entities is digital.
In that sense, since grains of salt are countable, the count is a "digital quanitity". Since you can't count "weights", the weight isn't digital.
I don't agree with that wording, personally. I've not come across the term "digital quantity", and frankly, we already have a term for that – it's called discrete, and all definitions that surround the term digital revolve around the concept of discreteness. So, calling a quantity digital feels like a circular definition:
- "Hey, what's a digital datum?"
- "It's something that represents a digital quantity."
- "So what's a digital quantity?"
- "Something representable by digital data."
As you notice, meh, that's not a definition.
Instead, we usually restrict the usage of the word "digital" to three use cases:
- Digital signals (vs. analog signals)
- Digital electronics
- Digital data
I'm working a lot with signals, so I have a favourite definition of this. Note that for something to be called digital signal, you need to have a mathematical signal model first. No model, no digital-ness!
A signal is digital if, and only if, it only exists for discrete loci and can only take one of a discrete set of values.
With locus, most often we mean time, but it might also be the position in an image, for example.
Discrete is the core concept here. We call sets discrete sets if they are countable, such as the Natural Numbers (1, 2, 3…), and all the sets that we can bijectively map to these (or a subset) – be it the Alphabet (a,b,c…), be it more abstract things like \$\mathbb Q\$ (yes, the rational numbers are countable. That's why the "weight of something" example is dangerous. The real numbers are not countable.)
Electronics that work with discrete steps – for example, the input of a flip flop is either high or low, never "anything in between. The circuitry works in a manner where it's only relevant in which of the discrete voltages, currents, frequencies … that are provisioned by the circuit's design the input falls, not its continuous value. (E.g., your flip flop doesn't care whether your input voltage is 0.0 V or 0.00001123288… V, if the threshold between high and low is 0.5 V)
This is a term that comes from information theory.
You have to ask yourself: Is something capable of transporting infinite information or not; if it's not capable, then whatever it is might be represented by digital data.
For example, dice might only show one of six sides showing up – we can very easily see that to represent the state of the die, we only need a finite amount of bits (less than three, actually).
On the other hand, when you spin a wheel and it has no "steps", and you just stop it at any angle in \$(0, 2\pi(\$, then the info "we hit exactly this angle" is not representable by any finite amount of bits, if you can just look closely enough.
Digital Data is hence a representation of something with finite information content – or its a lossy representation of something that used to contain a higher amount of information before it underwent digitization.
Coming back to your sand
Forget about "digital quantities". Think about quantities either being discrete (i.e. only taking values from a discrete set of values) or continuous (i.e. you can't just go ahead and count through all the values).
The set of possible numbers of grain in a bucket is discrete – it's a subset of \$\mathbf N\$, the natural numbers. The number of grains is a discrete quantity.
When you count the number of grains in that bucket once per week, you get a digital signal; it exists once per week, and it can only take discrete values.
When you build a digital scale to weigh the sand, what really happens is that some sensor measures the pressure on a special structure and converts it to a current, that an amplifier amplifies. If you where to understand that current as a function over time, you'd notice that it looks something like \$f:\, \mathbb R \mapsto \mathbb R\$, i.e. the continuous quantity (locus) time is mapped the continuous quantity current. That is an analog signal. Then, to be digital, your scale would need an analog to digital converter, that, for example, would measure whether the current is below \$a\$ mA, below \$2a\$ mA, below \$3a\$ mA, \$4a\$ … \$1000a\$ mA. The highest step that it is still above would be the quantized value. Since that converter is only sampling for discrete times, it converts an analog to a digital signal – it is an Analog-to-Digital Converter (ADC). From there on, digital circuitry processes the signal, converts it to other digital signals used to control the display on the scale. In contrast, the amplifier directly after the pressure sensor is not digital circuitry.